Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Problem with sprite display

Author
Message
Lolo19
20
Years of Service
User Offline
Joined: 15th Oct 2003
Location:
Posted: 16th Oct 2003 02:36
Hi

I have a strange problem. I load an image ( a 20x20 red ball on a black background ) and I want use sprite command to display this beautifull ball :p. Look my 2 code :

Code 1 : Work Well


Code 2 : Don't work


When I use code2 , something strange happens. It was as if my image was cut in 4 part and only the top left part was displayed. I need code 2 to animate my sprite .
Could you help me pls??

May the force be with you
Guyon
20
Years of Service
User Offline
Joined: 6th Jun 2003
Location: United States
Posted: 16th Oct 2003 21:28 Edited at: 16th Oct 2003 22:03
In code 1 you load and display your sprite.

In Code 2 you keep loading your sprite over and over, that "should" be a Play Sprite command. The reason I say "should" is, there are two problems with animated sprites. Check out the bug forum.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Oct 2003 23:56
Hmm, I don't think that's the problem at all ... the code should run Ok - remember that there is no POSITION SPRITE command, so this is the only way you can reposition a sprite (unless using MOVE SPRITE).

@Lolo19, can you try changing your LOAD IMAGE command by adding an extra ,1 to the end?
Lolo19
20
Years of Service
User Offline
Joined: 15th Oct 2003
Location:
Posted: 17th Oct 2003 03:12
I have resized my image :
16x16 is ok
25x25 is no good
32x32 is ok

So I think it must be power of 2

May the force be with you
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 17th Oct 2003 06:39
What graphics card do you have?
I think some old ones have that limitation.
Lolo19
20
Years of Service
User Offline
Joined: 15th Oct 2003
Location:
Posted: 17th Oct 2003 15:04
Yes maybe , i have a TNT graphics cards ^^

May the force be with you
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Oct 2003 00:26
That's why you should add the extra parameter to your LOAD IMAGE commands ... it ensures that DBPro doesn't resize your images to power-of-2 sizes.

Login to post a reply

Server time is: 2024-04-28 05:07:48
Your offset time is: 2024-04-28 05:07:48