Scrolling Game Development Kit Forum
Welcome,
Guest
. Please
login
or
register
.
2010-09-09, 05:42:33 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
8920
Posts in
1007
Topics by
168
Members
Latest Member:
mogzdogz
Scrolling Game Development Kit Forum
SGDK Version 2
Help, Errors, FAQ
Could you add a MouseUp and initial only event?
« previous
next »
Pages:
[
1
]
Author
Topic: Could you add a MouseUp and initial only event? (Read 217 times)
SmartBoy16
Contributor
Fanatic
Posts: 554
Current Project: RANAT: BtT
Could you add a MouseUp and initial only event?
«
on:
2010-02-22, 08:02:13 AM »
I'm just throwing out a few suggestions for the next release.
For the IsMousePressed function, is there a way to add an "Initial Only" thingy to it?
And how about a IsMouseUp Function?
I've completed both on my own by using a series of flags and if/elseif statements (On my next Midnight release) but it would be nice to have those built in.
Logged
SmartBoy16
The RANAT Foundation: Before the Truth
http://www.box.net/RANAT-BtT
bluemonkmn
SGDK Author
Administrator
Fanatic
Posts: 2146
Re: Could you add a MouseUp and initial only event?
«
Reply #1 on:
2010-02-22, 09:12:53 AM »
IsMouseUp is the same as Not IsMousePressed, right? Why not just use that (check the "Not" box)?
To implement Initial Only for the mouse, you could add a parameter to the mouse pointer sprite (assuming you have a mouse pointer sprite) called "WasMousePressed" and then check:
1. If IsMousePressed
2. If WasMousePressed != 1
a. WasMousePressed = 1
b. Do Stuff for intial only mouse press ...
3. Else (if IsMousePressed was false) WasMousePressed = 0
Logged
Ben Marty
Scrolling Game Development Kit 2
SmartBoy16
Contributor
Fanatic
Posts: 554
Current Project: RANAT: BtT
Re: Could you add a MouseUp and initial only event?
«
Reply #2 on:
2010-02-22, 10:00:18 AM »
that's exactly what i did! except for the last else i made a new function, copied the IsMousePressed, and changed the "!=" to "==". it works, but I guess your way is a lot easier.
Logged
SmartBoy16
The RANAT Foundation: Before the Truth
http://www.box.net/RANAT-BtT
bluemonkmn
SGDK Author
Administrator
Fanatic
Posts: 2146
Re: Could you add a MouseUp and initial only event?
«
Reply #3 on:
2010-02-23, 06:15:57 AM »
The reason IsMouseUp is not built in is because it just seems silly to create another whole function when all you have to do is check a box on an existing function.
The reason Initial Only isn't available for the mouse (I see now) is because if you use MapMouseToSprite, you should be able to use IsInputPressed (which already has InitialOnly) to check the state of the mouse buttons on that sprite.
Logged
Ben Marty
Scrolling Game Development Kit 2
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
SGDK Version 2
-----------------------------
=> News and Announcements
=> Help, Errors, FAQ
=> General Discussion
=> Projects
-----------------------------
SGDK Version 1
-----------------------------
=> News and Announcements
=> Help/FAQ
=> General Discussion
=> Script
=> Projects
-----------------------------
General
-----------------------------
=> Game Development Artistry
=> Off-Topic
Loading...