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.

iOS and MacOS / AGK Sprite - clickable in invisible mode! This is a bug or feature or a glitch?

Author
Message
Commandor
11
Years of Service
User Offline
Joined: 25th Jan 2011
Location: Kiev, Ukraine
Posted: 25th Sep 2012 20:32
Why sprite in invisible mode - pressed?

Life is our game, playing we live!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Sep 2012 21:23
You need to provide a whole lot more information. Showing the code that sets up the sprite and does whatever when pressed would help.

Making a sprite not visible doesn't take it out of play for physics and such.

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 25th Sep 2012 21:32
yes a sprite will still return a click/touch positive response weather invisible or not.

this a good feature, because you can put invisible square sprites on the screen and use these to control a character if the player presses left or right.

if you don't want your sprites to be click detected, move your invisible sprites to a SPRITE GROUP and put a condition so that clicks are only detected for a certain SPRITE GROUP.

SPRITE GROUPS are VERY Powerful!
Commandor
11
Years of Service
User Offline
Joined: 25th Jan 2011
Location: Kiev, Ukraine
Posted: 25th Sep 2012 21:43
Quote: "this a good feature, because you can put invisible square sprites on the screen and use these to control a character if the player presses left or right."


For this is 'DummySprite'. Simple sprites do not have to click in invisible mode.

Life is our game, playing we live!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Sep 2012 22:21
Quote: "Simple sprites do not have to click in invisible mode."

Really, I don't think that is correct. Unless you do something like bjadams suggests, all sprites, visible or not, will respond to clicks/touchs, unless they are behind another sprite.

Do you have some sample code that shows otherwise?

Cheers,
Ancient Lady
AGK Community Tester
Commandor
11
Years of Service
User Offline
Joined: 25th Jan 2011
Location: Kiev, Ukraine
Posted: 25th Sep 2012 22:42
Large sample code...

To quickly move from the location to the location I pre-load the sprite animations and effects. But in some locations, they do not need and I do not unload them and makes them invisible. But they remain clickable and obscured other sprites.

Life is our game, playing we live!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Sep 2012 23:34
Try moving the invisible ones 'off' the screen, then they won't be clickable because they won't be where the user can click them.

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 27th Sep 2012 00:09
either move them off the screen or use sprite groups

this is the way agk works, and i see nothing out of this world, it's very easy to get used to this system
Rich Dersheimer
AGK Developer
13
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 27th Sep 2012 17:49
If you have one big sprite for your background image, you can just put the sprites you don't need "behind" the big one, using SetSpriteDepth(). Assigning the sprites to sprite groups would make it very easy to put a whole group "behind" or "in front of" that background sprite.

That screenshot is beautiful!

Commandor
11
Years of Service
User Offline
Joined: 25th Jan 2011
Location: Kiev, Ukraine
Posted: 27th Sep 2012 22:09 Edited at: 27th Sep 2012 22:11
For all this, it is necessary to write any code to hide and to show! In my own engine for Windows I made two properties the sprite: Enable & Visible. Enable - for update, Visible - for render. This provides a rich opportunity to work with sprites in automatic mode. Also added the ability to click according to transparency. All this is not in AppGameKit, where to do this all the time to set the depth and display the sprite off the screen. In sprite group lacks the ability to specify the sequence of animations of sprites in the group - and it is most often used in interactive.


Quote: "That screenshot is beautiful!"

To Rich Dersheimer: Thanks!

Life is our game, playing we live!

Login to post a reply

Server time is: 2022-10-04 15:29:02
Your offset time is: 2022-10-04 15:29:02