Hello everyone,
My problem is the following :
I've got a sprite loaded. Basically, it's a tileset which i need to clip from to display a specific tile.
My problem is that i need to put that clipped part of the sprite tileset into an image (i'm working on a map editor and i can't display sprites in my listicon gadget).
So, the difficult part is to display the sprite on the image. I've tried a bit with bitblt_ function but i don't understand it fully, so i might be making a mistake somewhere.
Does anyone has an idea on how to copy a (clipped) sprite onto an image ?
Thanks in advance,
Pythagoras
How to copy a (clipped) sprite on an image ?
-
- User
- Posts: 13
- Joined: Wed Aug 20, 2003 11:08 am
can't think a way to do that
but what you ask can be done diffrently with image commands
a) load the big image in a temporary image
b) grabimage ,grabimage grabs a square from another image and creates a new one
later if you wish to make sprites too you can use 2DDrawing command to
drawimage() in sprite -> startdrawing(spriteoutput())

OOT are you greek ?
but what you ask can be done diffrently with image commands

a) load the big image in a temporary image
b) grabimage ,grabimage grabs a square from another image and creates a new one

later if you wish to make sprites too you can use 2DDrawing command to
drawimage() in sprite -> startdrawing(spriteoutput())

OOT are you greek ?
Christos
of course it can be done.. 
just load your tile image into a sprite, set drawing to another
image or sprite, and use this procedure to display the different tiles..

just load your tile image into a sprite, set drawing to another
image or sprite, and use this procedure to display the different tiles..

Code: Select all
Procedure DrawClippedSprite(image, x, y, sizex, sizey, frame)
Protected initwidth.l, initheight.l, yc.l
initwidth = SpriteWidth(image)
initheight = SpriteHeight(image)
yc = Int(Round((frame * sizex) / initwidth,0))
frame = frame - (yc * Int((initwidth / sizex)))
yc = (yc * sizey)
; get the right part of the image
ClipSprite(image,sizex * frame, yc, sizex, sizey)
DisplayTransparentSprite(image,x,y)
; reset the clipsprite back to the initial values (size)
ClipSprite(image,0,0,initwidth,initheight)
EndProcedure
AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
-
- User
- Posts: 13
- Joined: Wed Aug 20, 2003 11:08 am
Thanks for your replies. I'll try the grabimage tip, looks like the best way to achieve it.
LarsG :
Your function is great and will turn out useful but what i was looking for was basically to copy a sprite onto an image. As far as I know, it's not possible to make a call for displaysprite and have it displayed onto an image (startdrawing(imageoutput()) ?)
plouf :
Nai, vre
. Ypothetw k'esy ; Apo Athina ;
LarsG :
Your function is great and will turn out useful but what i was looking for was basically to copy a sprite onto an image. As far as I know, it's not possible to make a call for displaysprite and have it displayed onto an image (startdrawing(imageoutput()) ?)
plouf :
Nai, vre
