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 / request - MORE VIRTUAL BUTTONS!

Author
Message
haliop
User Banned
Posted: 26th Apr 2013 10:39
please ?
i really like them alot
and i use them but i defently need more then 12 max.. :/
i have a way around it .. but was just wondering if this is possible

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Apr 2013 14:30
a workaround is using sprites and FixSpriteToScreen,getspritehit.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Apr 2013 18:29
I stopped using Virtual Buttons because of that limitation (and reliability) and switched to doing my own buttons and using GetSpriteHitTest to determine if one one selected.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
haliop
User Banned
Posted: 26th Apr 2013 18:57 Edited at: 26th Apr 2013 18:58
i know the workaround and i actually use a better method then sprite hit since i actually dont really know the code inside sprites and i assume as i know TGC products its not 100 percent proof.


i use the simpliest and oldest trick in the book.
can work with sprites also and its about the same as sprite hit only that if you have too many sprites or if sprites depth is not sorted correctly this will work best and i think even faster then sprite hit.

if using pointer


and yes i know what you thinking about well what if the button is rotated or somehow .. the pointer may not touch it exactly as it should with spritehit.. but since we are talking about buttons which are most likely to be static... i think this method is much better then spriteHit please correct me if im wrong..

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Apr 2013 19:20
haliop, I used your technique as well. I recently went over to the hit test because most of my buttons are now ovals.

And, in Tier 2, it is so easy to create classes and then let them handle the details.

I have a spritebutton class and then a spritebuttonset class (not those names, but it gets the idea across). The spritebuttonset class checks for a pointer click. If nothing, then just returns. If clicked, it stores the value (and there is a method that also returns the click state and position) and then has each of the spritebuttons in its list check themselves. If one has been clicked, it returns the stored non-zero return value, otherwise it returns zero. In the spritebuttonset method, as soon as something returns non-zero, it stops and returns that value. The spritebutton also only checks for click if it is visible.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Apr 2013 23:06
i write my feature requests here:
http://code.google.com/p/agk/issues/list
easter bunny
11
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 27th Apr 2013 03:06
I've built my own function for them that supports multitouch or GetPointer[foo]()

Here you go, if you decide to use it:


haliop
User Banned
Posted: 27th Apr 2013 11:44
very nice multi touch !! ty for sharing..
ok i'll keep at it in my way with chekcing x and y according to sprites...

ty all for sharing your code and thoughts.

Login to post a reply

Server time is: 2024-05-02 02:22:46
Your offset time is: 2024-05-02 02:22:46