Need help with something.. kind of advanced?

Non-platform specific questions.

Need help with something.. kind of advanced?

Postby Hblade » Thu Apr 05, 2012 7:12 am

EDIT: I have found a way =) But Im going to keep this post up incase I learn any other methods

Hi everyone. I've been working on a window system for about .. OMG lol, it felt like an hour but its been about 4 O_o maybe.. anyways, its like 3:08 AM and I didn't even realize it lol

Anyways my issue is:
I've created the window system as said, one that uses only 1 canvas, heres a screenshot.
Screenshot-Game Editor.png


This is all being done through 1 canvas. I have hotsopts, where you can type a simple line to create them, but what I need to know is:

How can I go about making an event where say, if you CLICKED on that hotspot, like for example

new event -> mousedown -> script editor
Code: Select all
if(spotClick[hotspot_index])
{
    //
}


I've given each hotspot a user index, as well as the widnows to maintain multiple windows. it works using arrays, so I store the X and Y of the created windows, and the created choice thingies as well, this is because I have a function called sendTo(offsetx, offsety, windowindex) and a sendToHotspot the same, and those work, it allows you to send an object to the same position as the windows or the hotspot.

Also, I have a lag-prevention system, that prevents the windows from constantly updating unless they need to, this maintains framerate.

So anyone have any idea how I can determine if a "hotspot" was clicked? :D I'd like to release this.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Need help with something.. kind of advanced?

Postby tintran » Sat Apr 07, 2012 9:15 pm

idea: make a hot spot an actor that's semi-transparent. that's all i can think of, if you make it fully-transparent mousedown-event doesn't get called.
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score

Re: Need help with something.. kind of advanced?

Postby Hblade » Sun Apr 08, 2012 4:06 am

Check the game demos :P I solved it. Here's how:

You need to check and see if the xmouse and ymouse is inbetween the X and Y + (X+width) and (Y+height) of the hotspot :3 If so, set a variable with the ID of the hotspot (Arrays)
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest