About Store Forum Documentation Contact



Post Reply 
Sprites
Author Message
Spyros Offline
Member

Post: #1
Sprites
Hi all,
Totally new here, so sorry for may be newbie question.
In a Gui, is it possible to have a sprite instead of a static image?
Playing with the Gui editor, I didn't find something for this.

Thanks
Spyros

PS The new web site is very nice! grin
06-22-2009 01:18 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
Re: Sprites
Welcome to the forum!

Could you tell more about the sprite instead of an image? Do you mean an animated image?
If yes, then you'd need to check out the gui tutorial with extending the gui object classess and programming manual drawing. There you should manually program drawing animated images

Quote:PS The new web site is very nice! grin
Thanks smile
06-22-2009 01:24 PM
Find all posts by this user Quote this message in a reply
Spyros Offline
Member

Post: #3
Re: Sprites
Thanks for your quick reply,
Yes, I mean animated images.
My game is an Adventure and I need those images (items, cursors, puzzles).
Well, I.m not much of a coder (mostly graphics stuff),
but I'll try figure it out.

Thanks again,
Spyros
06-23-2009 01:17 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
Re: Sprites
You can do it like this:

initialize:
Memb<Image*> images;

load:
images.New()=Images("frame1");
images.New()=Images("frame2");
images.New()=Images("frame3");


draw:
if(Int elements=images.elms())
{
Int frame=Trunc(Tm.time())%elements;
images[frame].draw(..);
}

something more or less like it smile
06-23-2009 01:23 PM
Find all posts by this user Quote this message in a reply
Post Reply