Update/add Go functions

This commit is contained in:
Milan Nikolic 2021-11-11 16:34:15 +01:00
parent 607adace28
commit 2013bc4628
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
17 changed files with 268 additions and 211 deletions

View file

@ -2,8 +2,9 @@ package raygui
import (
"fmt"
"github.com/gen2brain/raylib-go/raylib"
"time"
rl "github.com/gen2brain/raylib-go/raylib"
)
var backspaceHeld = false
@ -11,6 +12,7 @@ var nextBackspace = time.Now()
// BackspaceRepeatDelay controls the time backspace must be held down before it will repeat.
var BackspaceRepeatDelay = 300 * time.Millisecond
// BackspaceRepeatInterval controls how frequently backspace registers after the initial delay.
var BackspaceRepeatInterval = 60 * time.Millisecond
@ -54,7 +56,7 @@ func TextBox(bounds rl.Rectangle, text string) string {
if state == Focused || state == Pressed {
// Draw a cursor, when focused.
if (framesCounter2/20)%2 == 0 {
rl.DrawRectangle(b.X+4+rl.MeasureText(text, int32(style[GlobalTextFontsize])), b.Y+2, 1, b.Height-4, rl.GetColor(int32(style[TextboxLineColor])))
rl.DrawRectangle(b.X+4+rl.MeasureText(text, int32(style[GlobalTextFontsize])), b.Y+2, 1, b.Height-4, rl.GetColor(uint(style[TextboxLineColor])))
}
}