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.

AppGameKit Classic Chat / Нow to load sprites and clear the screen?

Author
Message
metamorpho
2
Years of Service
User Offline
Joined: 17th Oct 2016
Location: Planet Earth
Posted: 20th Apr 2019 14:56
Help
I want to understand, but I do not understand

I programmed on Blitz3d and did it there
fantom = LoadTexture ("rycar2.png"): ryc_2 = CreateImage (fantom, 64,64)
sprite was created and it was nowhere to be seen

and there was a team there CLS
she cleared the whole screen

1. How to create a sprite on the AppGameKit so that it is not visible on the screen?

Do I really need to hide every sprite using the SetSpriteVisible (iSpriteIndex, 0) command?
And if their 300 different sprites?

Found another option to specify the coordinates outside the screen SetSpritePosition (rn_load, -100, -100), but this is also not an option

Is there another way for AppGameKit?


2. How can I clean the screen of all sprites on the AppGameKit?

ClearScreen () command does not help, sprites remain on the screen
Is it necessary to hide all sprites again using the SetSpriteVisible (iSpriteIndex, 0) command?

Is there another way ?
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 20th Apr 2019 16:54 Edited at: 20th Apr 2019 17:06
Quote: "
1. How to create a sprite on the AppGameKit so that it is not visible on the screen?"

SetSpriteVisible ( iSpriteIndex, bVisible ) is the only way

but you could use an array

but it is best to create a sprite as a type


or you could if you don't need the sprites anymore
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
metamorpho
2
Years of Service
User Offline
Joined: 17th Oct 2016
Location: Planet Earth
Posted: 20th Apr 2019 17:09
fubarpk, thanks

The array is not suitable, because 300 sprites and each sprite is conveniently called a unique name, not a number.

It is a pity that I can not load the sprite into memory off-screen (
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 20th Apr 2019 17:18 Edited at: 20th Apr 2019 17:27
you can setSpritePosition(id,-100,-100)
but really you should not have 300 different names all scene editors
create an array of sprites. It is so much easier to handle them

ir you could load the textures for you sprites easier
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 20th Apr 2019 17:35
failing that you could use a textfile that is like a map for your sprites
where the text file would tell you what texture to associate with each sprite
the sprites size position etc

and when you read the text file you create your array of sprites set up as they
are defined in the text file where you may even have a type defined ie monster
ie player and/or the group its defined in the depth to place the sprite at etc

but 300 sprites should be setup in code with no more than 5 lines of code
not 1000
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk

Login to post a reply

Server time is: 2019-08-21 01:38:44
Your offset time is: 2019-08-21 01:38:44