mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2026-03-20 10:52:52 +01:00
counter screen and interval checking in main.go
This commit is contained in:
@@ -22,6 +22,7 @@ type LabelInterface interface {
|
||||
GetText() string
|
||||
SetText(text string)
|
||||
Draw()
|
||||
DrawCenter(bold bool)
|
||||
}
|
||||
|
||||
type Label struct {
|
||||
@@ -87,6 +88,15 @@ func (self *Label) SetText(text string) {
|
||||
self.Width,self.Height = font.Size(self.FontObj, self.Text)
|
||||
}
|
||||
|
||||
func (self *Label) DrawCenter(bold bool) { // default bold is false
|
||||
font.SetBold(self.FontObj,bold)
|
||||
my_text := font.Render(self.FontObj,self.Text, true, self.Color, nil)
|
||||
|
||||
rect_ := draw.MidRect(self.PosX,self.PosY,self.Width,self.Height,Width,Height)
|
||||
|
||||
surface.Blit(self.CanvasHWND,my_text,rect_,nil)
|
||||
}
|
||||
|
||||
func (self *Label) Draw() {
|
||||
font.SetBold(self.FontObj,false) // avoing same font tangling set_bold to others
|
||||
|
||||
|
||||
Reference in New Issue
Block a user