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 / [SOLVED] Command for "Mouse Over Sprite" return?

Author
Message
JoeOh45240
7
Years of Service
User Offline
Joined: 14th Feb 2017
Location: USA
Posted: 6th Jan 2020 05:42
Is there a way to tell if the mouse is over a sprite by returning a 1 and if it's not return a zero? If so what commands do i need to make that happen? Thanks.

The author of this post has marked a post as an answer.

Go to answer

PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 6th Jan 2020 05:51 Edited at: 6th Jan 2020 05:55
This post has been marked by the post author as the answer.
GetSpriteHitTest() to return TRUE or FALSE
GetSpriteHit() to return the sprite's ID


PSY


PSY LABS Games
Coders don't die, they just gosub without return
AliceSim1
5
Years of Service
User Offline
Joined: 15th Oct 2018
Location: Barcelona
Posted: 6th Jan 2020 10:49
One question: I use VirtualButtons to create buttons on the screen, in turn I use a graphic sprite as a button.
if I don't use VirtualButtons ... and I only use this command to return TRUE only with Sprites, without using VirtualButton.
I really don't like to assign a chart to VirtualButton directly, because you can't change the Z depth of the Virtual buttons.
That's why I use Sprites to display buttons.
and use VirtualButton to control the collision and button pressure.
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 6th Jan 2020 12:52 Edited at: 6th Jan 2020 12:53
Hey Alice,

I don't understand your question. Can you rephrase?

Personally, I don't use virtual buttons unless the buttons are invisible/transparent and I just want to catch the user's input in a certain rectangular area.
With sprites, you have much more control, like you already said.


PSY LABS Games
Coders don't die, they just gosub without return
AliceSim1
5
Years of Service
User Offline
Joined: 15th Oct 2018
Location: Barcelona
Posted: 6th Jan 2020 15:24
"Personally, I don't use virtual buttons unless the buttons are invisible / transparent and just want to capture user input in a certain rectangular area.
With sprites, you have much more control, as you said."

Yes, I realized and I use it as you say.
The rectangular area to detect the on-screen button works very well. (such as "Press" "Statte" physical buttons ...)
I paint a Sprite, and above a Text and I can place a top Sprite for the mouse pointer if I wish.
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 6th Jan 2020 19:40 Edited at: 6th Jan 2020 19:42
Hi, AliceSim1, you can check without sprite. AABB function.



Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-20 04:34:46
Your offset time is: 2024-04-20 04:34:46