Basic cursor

This commit is contained in:
bloeys
2022-02-26 09:09:55 +04:00
parent ceda79cffb
commit d99b122ee5
2 changed files with 43 additions and 11 deletions

View File

@ -166,6 +166,11 @@ func (g *Gopad) Update() {
g.showErrorPopup()
}
if input.MouseClicked(sdl.BUTTON_LEFT) {
x, y := input.GetMousePos()
g.getActiveEditor().SetCursorPos(int(x), int(y))
}
//Close editor if needed
if input.KeyDown(sdl.K_LCTRL) && input.KeyClicked(sdl.K_w) {
g.closeEditor(g.activeEditor)