mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2026-03-19 02:12:46 +01:00
abs=>Abs
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package UI
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/veandco/go-sdl2/sdl"
|
||||
"github.com/veandco/go-sdl2/ttf"
|
||||
|
||||
@@ -101,11 +103,12 @@ func (self *MultiLabel) blit_text(surf *sdl.Surface,text string, pos_x,pos_y int
|
||||
row_total_width := 0
|
||||
lines := 0
|
||||
|
||||
for i,line := range words[:4] {
|
||||
for _,line := range words[:4] {
|
||||
word_height := 0
|
||||
for _,word := range line[:12] {
|
||||
word_surface := font.Render(fnt,word,true,self.Color,nil)
|
||||
word_width := surface.GetWidth(word_surface)
|
||||
word_height := surface.GetHeight(word_surface)
|
||||
word_height = surface.GetHeight(word_surface)
|
||||
row_total_width += word_width
|
||||
if row_total_width+space >= max_width {
|
||||
x = pos_x
|
||||
|
||||
@@ -190,6 +190,7 @@ type PageInterface interface {
|
||||
DrawIcons()
|
||||
|
||||
GetName() string
|
||||
SetName(n string)
|
||||
GetFootMsg() [5]string
|
||||
|
||||
KeyDown( ev *event.Event)
|
||||
@@ -979,6 +980,10 @@ func (self *Page) GetName() string {
|
||||
return self.Name
|
||||
}
|
||||
|
||||
func (self *Page) SetName(n string) {
|
||||
self.Name = n
|
||||
}
|
||||
|
||||
func (self *Page) SetIndex(idx int) {
|
||||
self.Index = idx
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@ package UI
|
||||
|
||||
import (
|
||||
"github.com/veandco/go-sdl2/sdl"
|
||||
"github.com/veandco/go-sdl2/ttf"
|
||||
// "github.com/veandco/go-sdl2/ttf"
|
||||
|
||||
"github.com/cuu/gogame/surface"
|
||||
"github.com/cuu/gogame/rect"
|
||||
// "github.com/cuu/gogame/surface"
|
||||
// "github.com/cuu/gogame/rect"
|
||||
"github.com/cuu/gogame/color"
|
||||
"github.com/cuu/gogame/font"
|
||||
// "github.com/cuu/gogame/font"
|
||||
"github.com/cuu/gogame/draw"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/cuu/LauncherGo/sysgo"
|
||||
)
|
||||
|
||||
func abs(n int) int {
|
||||
func Abs(n int) int {
|
||||
y := n >> 63
|
||||
return (n ^ y) - y
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user