Feature Creep / Is there a way to interact with Sprites?

Author
Message
Polaraul
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 30th Jan 2014
Location:
Posted: 7th Oct 2016 10:43 Edited at: 7th Oct 2016 10:45
I see that Lua commands are now available to add sprites to the screen, but are there commands to detect when the mouse has clicked on a sprite?

*** Ooops, sorry, wrong forum.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Oct 2016 10:56
As long as its square/rectangle you can do it with the position of the mouse and manually check its within the border/location of the sprite.
Sorites and mouse position are both % based so its very easy, just check x and y are greater than the sprites position and also less than the sprites position+it's dimensions.

For pixel perfect detection... No, unless you again code it yourself but it would take forever for complicated shapes.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 17th Oct 2016 12:06 Edited at: 17th Oct 2016 12:25
Here's an example:


i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.

Login to post a reply

Server time is: 2024-03-29 12:57:48
Your offset time is: 2024-03-29 12:57:48