mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-24 00:27:59 -05:00
31 lines
581 B
Haxe
31 lines
581 B
Haxe
|
package funkin.ui.haxeui.components;
|
||
|
|
||
|
import haxe.ui.components.TextField;
|
||
|
import funkin.input.Cursor;
|
||
|
import haxe.ui.events.MouseEvent;
|
||
|
|
||
|
/**
|
||
|
* A HaxeUI text field which:
|
||
|
* - Changes the current cursor when hovered over.
|
||
|
*/
|
||
|
class FunkinTextField extends TextField
|
||
|
{
|
||
|
public function new()
|
||
|
{
|
||
|
super();
|
||
|
|
||
|
this.onMouseOver = handleMouseOver;
|
||
|
this.onMouseOut = handleMouseOut;
|
||
|
}
|
||
|
|
||
|
private function handleMouseOver(event:MouseEvent)
|
||
|
{
|
||
|
Cursor.cursorMode = Text;
|
||
|
}
|
||
|
|
||
|
private function handleMouseOut(event:MouseEvent)
|
||
|
{
|
||
|
Cursor.cursorMode = Default;
|
||
|
}
|
||
|
}
|