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.

Newcomers AppGameKit Corner / SetSpriteVisible for the first CreateSprite ?

Author
Message
c0d3r9
2
Years of Service
Recently Online
Joined: 2nd Oct 2017
Location:
Posted: 14th Feb 2018 13:49 Edited at: 14th Feb 2018 20:55
I have this code to fill a map.
But always is the first created Sprite on position 0, 0.
How can i make this invisible.
Intern the sprite indexes seem to start with 100001...100002 and so on.
Try to make 100001 invisible has no effect.

Even on the left-top corner o see the damned sprite.(if i scroll to right the sprite seems fix to screen)
The Fillfunction


I now edit the code above this way


I insert SetSpritePosition(tmap[a,b], a*32, b*32) in the loop.
Question: Because in the Fillfunction it draws all sprites are they deletet in the mainloop?
My Drawfunction in the mainloop is that:

Does AppGameKit draws now only the visible Sprites?
The For - Next loop (x) only runs 16 tiles in width.

If it only draws that visible sprites all is fine.

Sorry for my confused questions and english isnĀ“t my first language.

Edit: okay it seems that if i fill one time the tilemap with createsprites then all sprites are available.
I scroll with SetViewOffset across the complete map.

But i want only draw the sprites wich are in the View.
Btw. maybe i should do that all with the View.

Login to post a reply

Server time is: 2020-02-16 21:51:17
Your offset time is: 2020-02-16 21:51:17