Spyros
Member
|
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!
|
|
06-22-2009 01:18 PM |
|
Esenthel
Administrator
|
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!
Thanks
|
|
06-22-2009 01:24 PM |
|
Spyros
Member
|
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 |
|
Esenthel
Administrator
|
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
|
|
06-23-2009 01:23 PM |
|