We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be nice if Flixel had an easy way of changing the cursor when hovering over a button (typically made to look like a hand) built into it.
For now I hacked it in to my project with these changes, but it would be nice if it was supported out of the box:
In FlxButton: while(i < l) { camera = cameras[i++] as FlxCamera; FlxG.mouse.getWorldPosition(camera,_point); if(overlapsPoint(_point,true,camera)) { offAll = false; if(FlxG.mouse.justPressed()) { status = PRESSED; if(onDown != null) onDown(); if(soundDown != null) soundDown.play(true); } if(status == NORMAL) { status = HIGHLIGHT; FlxG.mouse.load(Assets_Ui.cursor_hand, 1, -9); // added this if(onOver != null) onOver(); if(soundOver != null) soundOver.play(true); } } } if(offAll) { if(status != NORMAL) { FlxG.mouse.load(Assets_Ui.cursor_point, 1, -9); // added this if(onOut != null) onOut(); if(soundOut != null) soundOut.play(true); } status = NORMAL; }
In FlxState: public function create():void { FlxG.mouse.load(Assets_Ui.cursor_point, 1, -9); }
In all of my states that extend FlxState: override public function create():void { super.create();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It would be nice if Flixel had an easy way of changing the cursor when hovering over a button (typically made to look like a hand) built into it.
For now I hacked it in to my project with these changes, but it would be nice if it was supported out of the box:
In FlxButton:
while(i < l)
{
camera = cameras[i++] as FlxCamera;
FlxG.mouse.getWorldPosition(camera,_point);
if(overlapsPoint(_point,true,camera))
{
offAll = false;
if(FlxG.mouse.justPressed())
{
status = PRESSED;
if(onDown != null)
onDown();
if(soundDown != null)
soundDown.play(true);
}
if(status == NORMAL)
{
status = HIGHLIGHT;
FlxG.mouse.load(Assets_Ui.cursor_hand, 1, -9); // added this
if(onOver != null)
onOver();
if(soundOver != null)
soundOver.play(true);
}
}
}
if(offAll)
{
if(status != NORMAL)
{
FlxG.mouse.load(Assets_Ui.cursor_point, 1, -9); // added this
if(onOut != null)
onOut();
if(soundOut != null)
soundOut.play(true);
}
status = NORMAL;
}
In FlxState:
public function create():void
{
FlxG.mouse.load(Assets_Ui.cursor_point, 1, -9);
}
In all of my states that extend FlxState:
override public function create():void
{
super.create();
The text was updated successfully, but these errors were encountered: