28 lines
549 B
Go
28 lines
549 B
Go
package ox
|
|
|
|
import "surdeus.su/core/gg/mx"
|
|
import "surdeus.su/core/gg"
|
|
|
|
// The type implements basic drawable text.
|
|
// (Now needs to implement rotation, scaling etc, cause now only position)
|
|
type Text struct {
|
|
ObjectImpl
|
|
mx.Transform
|
|
Data string
|
|
Face Face
|
|
Colority
|
|
Visibility
|
|
}
|
|
|
|
func (txt *Text) Draw(c gg.Context) []EVertex {
|
|
m := txt.Matrix()
|
|
m.Concat(c.Camera.RealMatrix())
|
|
//x, y := txt.Position.XY()
|
|
//text.Draw(c.Image)
|
|
text.DrawWithOptions(c.Image, txt.Data, txt.Face,
|
|
&ebiten.DrawImageOptions{
|
|
GeoM: m,
|
|
},
|
|
)
|
|
return nil
|
|
}
|