Documentation
¶
Index ¶
- Constants
- Variables
- func CenterLine(line string, filler rune, width int) string
- func GenerateSignAOAdd(text, color string, pos [3]int16, rotation Rotate, wall bool, id mt.AOID) mt.AOAdd
- func GenerateSignTexture(text string, wall bool, color string) mt.Texture
- func GenerateTextureAOMod(text string, wall bool, color string) *mt.AOCmdTextureMod
- func LoadCharMap()
- func Maths()
- func Ready(cc *proxy.ClientConn)
- func RegisterSign(ps *Sign)
- func SignProps() mt.AOProps
- func Unready(cc *proxy.ClientConn, srv string)
- func Update()
- type Center
- type ClickEvent
- type DynContent
- type Hop
- type Padding
- type PlayerCnt
- type Rotate
- type Sign
- type SignPos
- type Text
Constants ¶
const ( SIGN_WIDTH = 115 LINE_LENGTH = 15 NUMBER_OF_LINES = 4 LINE_HEIGHT = 13 CHAR_WIDTH = 5 PRINTED_CHAR_WIDTH = CHAR_WIDTH + 1 )
Variables ¶
var CharUrl = "" /* 135-byte string literal not displayed */
CharUrl is the Url the characters.txt file will be loaded from (default is official MineClone2 repos)
var Prefix string = "micl2_"
Prefix is the prefix before the chars
Functions ¶
func CenterLine ¶
CenterLine centers a line, by padding the same left and right (right one more with odd length strings)
func GenerateSignAOAdd ¶
func GenerateSignTexture ¶
GenerateSignTexture generates a sign texture (color has to be mt colorspec)
func GenerateTextureAOMod ¶
func GenerateTextureAOMod(text string, wall bool, color string) *mt.AOCmdTextureMod
Generates a mt.AOCmdTextureMod for some signtext
func LoadCharMap ¶
func LoadCharMap()
LoadCharMap downloads the character map from constant SignUrl (if not already have)
func Ready ¶
func Ready(cc *proxy.ClientConn)
Ready is called internaly Should not have to be called externaly
func RegisterSign ¶
func RegisterSign(ps *Sign)
Types ¶
type Center ¶
type Center struct { Filler rune Length int Content DynContent }
Padding is a `DynContent`
type ClickEvent ¶
type ClickEvent interface {
Click(cc *proxy.ClientConn, sign *Sign)
}
func ParseClick ¶
func ParseClick(s string) ClickEvent
ParseClick parses a Stringrepresentation of a ClickEvent
type DynContent ¶
type Hop ¶
type Hop struct {
Srv string
}
Hops is a `ClickEvent`, when clicked cc.Hop(Srv) is executed
type Padding ¶
type Padding struct { Prepend bool Length int Filler rune Content DynContent }
Padding is a `DynContent`, padding Content to be `Length` long filleed up by `Filler` while either `Prepending` or else Appending
type PlayerCnt ¶
type PlayerCnt struct {
Srv string
}
PlayerCnt is a `DynContent` replaced by the PlayerCount on Srv
type Rotate ¶
type Rotate uint8
func ParseRotationString ¶
ParseRotationString parses rotation string
type Sign ¶
type Sign struct { Pos *SignPos Text string Color string Dyn []DynContent OnClick ClickEvent // contains filtered or unexported fields }
func ParseScanner ¶
ParseScanner parses a bufio.Scanner into a []*Sign