Funkin/source/funkin/ui/haxeui/components/FunkinMenuItem.hx

31 lines
586 B
Haxe
Raw Normal View History

package funkin.ui.haxeui.components;
import funkin.input.Cursor;
import haxe.ui.events.MouseEvent;
import haxe.ui.containers.menus.MenuItem;
/**
* A HaxeUI menu item which:
* - Changes the current cursor when hovered over.
*/
class FunkinMenuItem extends MenuItem
{
public function new()
{
super();
this.onMouseOver = handleMouseOver;
this.onMouseOut = handleMouseOut;
}
private function handleMouseOver(event:MouseEvent)
{
Cursor.cursorMode = Pointer;
}
private function handleMouseOut(event:MouseEvent)
{
Cursor.cursorMode = Default;
}
}