Sprites?

tinmanjo

Member
Licensed User
2 questions about sprites.

What is the color for transparency?
How do i add a sprite with 1 frame only, im having trouble creating a single frame bitmap 30x30 pixels.

sprite.new1(\spr1.bmp,0,30,30,1)

doesn't seem to work.
 

agraham

Expert
Licensed User
Longtime User
What is the color for transparency?
Whatever you want usingGameWindow.SetTransparentColor1

sprite.new1(\spr1.bmp,0,30,30,1)

doesn't seem to work.
It won't. Sprite.New1 creates an empty Sprite. You need New2, your frame count is zero instead of one and you probably don't want the "\" preceding the filename as this implies that the file in in the filesystem root.

Have you read the help? It's all in there.
 

tinmanjo

Member
Licensed User
I have read the help but there isnt any form of example to clarify how to do something a certain way.
  • If you need to create a single framed sprite and add it to the game window then:-
  • etc...etc...
  • If you need to cycle through a series of frames.....
  • If you need to add remove sprites according to index....
  • How a sprite is referenced and how the gamewindow controls it.

The help is very sparse and doesn't explain very well how to actually do something it mearly gives syntax and usage which is no good for actually making something work, it's more of a reference manual imo, people learn by example. It's a shame that a section on sprites wasnt including in the free ebook (which is a really good thorough book which explains everything very well except sprite control etc..



sorry for my ranting...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…