Documentation ¶
Index ¶
- Constants
- Variables
- func CheckErr(err error)
- func DrawBoxToImage(img *ebiten.Image, x, y, w, h float64, col color.Color)
- func DrawLine(img *ebiten.Image, pnt1, pnt2 *Point, w float64, col color.Color)
- func Get1zu1Mapper(length int) map[int]int
- func GetRandomFloat(l, u float64) float64
- func GetRandomInt(l, u float64) int
- func GetRandomPos(x, y, w, h int) (int, int)
- func GetRandomPosInScreen(W, H int) (int, int)
- func GetRandomPosOutScreen(W, H int) (int, int)
- func GetSizeForText(str string, maxWidth, maxHeight int) (size float64)
- func GetStartPos4P(ID int, ScreenWidth, ScreenHeight, WallDis float64) (float64, float64, int)
- func GetWHForText(str string, size float64) (float64, float64)
- func ImgToEbitenImg(img *image.Image) *ebiten.Image
- func Init(path string)
- func InitAudioContext()
- func InitControlls(ControllerThresh float64, playerNum int) (error, *[]*Controller)
- func InitIcons(path string, sizes []int, fileformat string) (error, []image.Image)
- func IsInsideBox(bx, by, bw, bh, ox, oy, ow, oh float64) bool
- func LoadEbitenImg(path string) *ebiten.Image
- func LoadImg(path string) (error, *image.Image)
- func LoadMapper(path string) map[int]int
- func MakePopUpAt(screen *ebiten.Image, str string, x, y int, size float64, ...)
- func MaxFloat(vals ...float64) float64
- func OnAcceptData(c evio.Conn, in []byte) (out []byte, action evio.Action)
- func OnConnectionClosed(c evio.Conn, err error) (action evio.Action)
- func OnNewConnection(c evio.Conn) (out []byte, opts evio.Options, action evio.Action)
- func PrintTextAt(screen *ebiten.Image, str string, x, y int, r, g, b uint8, size float64)
- func SaveMapper(path string, mapper map[int]int)
- func UpdateControlls()
- type AudioPlayer
- type Button
- func GetButton(img *ImageObj, onPressLeft func(b *Button), onPressRight func(b *Button)) *Button
- func GetButtonWithText(img *ImageObj, str string, textCol color.RGBA, onPressLeft func(b *Button), ...) *Button
- func GetButtonWithTextBack(str string, X, Y, W, H float64, textCol, backCol color.RGBA, ...) *Button
- func GetButtonWithTextOnyl(str string, X, Y, W, H float64, textCol color.RGBA, ...) *Button
- type ButtonEventListener
- type Controller
- func (c *Controller) GetAxisValue(idx1, idx2 int) float64
- func (c *Controller) GetButtonValue(idx int) float64
- func (c *Controller) GetInfos() (out string)
- func (c *Controller) GetListenedBtns() []int
- func (c *Controller) LoadConfig(path string)
- func (c *Controller) RegisterButtonEventListener(listener ButtonEventListener)
- func (c *Controller) RegisterDirectionEventListener(listener DirectionEventListener)
- func (c *Controller) ResetButtonEventListener()
- func (c *Controller) ResetDirectionEventListener()
- func (c *Controller) SaveConfig(path string)
- func (c *Controller) SetMapper(oldidx, newidx int)
- func (c *Controller) UpdateAll() (int, int)
- func (c *Controller) UpdateController()
- func (c *Controller) UpdateControllerAll()
- func (c *Controller) UpdateControllerButtons(buttons ...int)
- func (c *Controller) UpdateKeyBoard()
- func (c *Controller) UpdateKeyBoardAll()
- func (c *Controller) UpdateKeys(keys ...int)
- func (c *Controller) UpdateListeners()
- func (c *Controller) UpdateOnlyNeeded() (int, int)
- func (c *Controller) UpdateSmartPhone()
- func (c *Controller) UseCurrentAxisValsAsStandard()
- type DirectionEventListener
- type ImageObj
- type Params
- type Point
- func (p *Point) CollidesWithPnt(pnt *Point) bool
- func (p *Point) CollidesWithPnts(pnts []*Point) *Point
- func (p *Point) CollidesWithWall(XTiles, YTiles float64) bool
- func (p *Point) Copy() *Point
- func (p *Point) Equals(p2 *Point) bool
- func (p *Point) GetDisTo(p2 *Point) float64
- func (p *Point) IsContained(pnts []*Point) bool
- func (p *Point) Print() string
- func (p *Point) ToVector() *Physics.Vector
- type Points
- type SmartPhoneConn
- type SmartPhoneServ
- type SnakeTiles
Constants ¶
View Source
const INITSTATE = "00000\n"
View Source
const PORT = 8080
View Source
const (
TextSizeScale = 0.75
)
Variables ¶
View Source
var ( GamepadSDLIDs map[int]string SmartServIPAddr string )
View Source
var ( AllKeys = []ebiten.Key{ ebiten.Key0, ebiten.Key1, ebiten.Key2, ebiten.Key3, ebiten.Key4, ebiten.Key5, ebiten.Key6, ebiten.Key7, ebiten.Key8, ebiten.Key9, ebiten.KeyA, ebiten.KeyB, ebiten.KeyC, ebiten.KeyD, ebiten.KeyE, ebiten.KeyF, ebiten.KeyG, ebiten.KeyH, ebiten.KeyI, ebiten.KeyJ, ebiten.KeyK, ebiten.KeyL, ebiten.KeyM, ebiten.KeyN, ebiten.KeyO, ebiten.KeyP, ebiten.KeyQ, ebiten.KeyR, ebiten.KeyS, ebiten.KeyT, ebiten.KeyU, ebiten.KeyV, ebiten.KeyW, ebiten.KeyX, ebiten.KeyY, ebiten.KeyZ, ebiten.KeyApostrophe, ebiten.KeyBackslash, ebiten.KeyBackspace, ebiten.KeyCapsLock, ebiten.KeyComma, ebiten.KeyDelete, ebiten.KeyDown, ebiten.KeyEnd, ebiten.KeyEnter, ebiten.KeyEqual, ebiten.KeyEscape, ebiten.KeyF1, ebiten.KeyF2, ebiten.KeyF3, ebiten.KeyF4, ebiten.KeyF5, ebiten.KeyF6, ebiten.KeyF7, ebiten.KeyF8, ebiten.KeyF9, ebiten.KeyF10, ebiten.KeyF11, ebiten.KeyF12, ebiten.KeyGraveAccent, ebiten.KeyHome, ebiten.KeyInsert, ebiten.KeyKP0, ebiten.KeyKP1, ebiten.KeyKP2, ebiten.KeyKP3, ebiten.KeyKP4, ebiten.KeyKP5, ebiten.KeyKP6, ebiten.KeyKP7, ebiten.KeyKP8, ebiten.KeyKP9, ebiten.KeyKPAdd, ebiten.KeyKPDecimal, ebiten.KeyKPDivide, ebiten.KeyKPEnter, ebiten.KeyKPEqual, ebiten.KeyKPMultiply, ebiten.KeyKPSubtract, ebiten.KeyLeft, ebiten.KeyLeftBracket, ebiten.KeyMenu, ebiten.KeyMinus, ebiten.KeyNumLock, ebiten.KeyPageDown, ebiten.KeyPageUp, ebiten.KeyPause, ebiten.KeyPeriod, ebiten.KeyPrintScreen, ebiten.KeyRight, ebiten.KeyRightBracket, ebiten.KeyScrollLock, ebiten.KeySemicolon, ebiten.KeySlash, ebiten.KeySpace, ebiten.KeyTab, ebiten.KeyUp, ebiten.KeyAlt, ebiten.KeyControl, ebiten.KeyShift} )
View Source
var TrueTypeFont *truetype.Font
Functions ¶
func Get1zu1Mapper ¶
func GetRandomFloat ¶
func GetRandomInt ¶
func GetRandomPos ¶
func GetRandomPosInScreen ¶
func GetRandomPosOutScreen ¶
func GetSizeForText ¶
func GetStartPos4P ¶
func InitAudioContext ¶
func InitAudioContext()
func InitControlls ¶
func InitControlls(ControllerThresh float64, playerNum int) (error, *[]*Controller)
func IsInsideBox ¶
func LoadEbitenImg ¶
func LoadMapper ¶
func MakePopUpAt ¶
func OnNewConnection ¶
func PrintTextAt ¶
func SaveMapper ¶
func UpdateControlls ¶
func UpdateControlls()
Types ¶
type AudioPlayer ¶
type AudioPlayer struct {
// contains filtered or unexported fields
}
AudioPlayer represents the current audio state.
func NewPlayer ¶
func NewPlayer(filename string) (*AudioPlayer, error)
func (*AudioPlayer) Close ¶
func (p *AudioPlayer) Close() error
func (*AudioPlayer) Play ¶
func (p *AudioPlayer) Play() error
type Button ¶
type Button struct { Img *ImageObj LPressed, RPressed, LastL, LastR, Active bool Data interface{} // contains filtered or unexported fields }
func GetButtonWithText ¶
func GetButtonWithTextBack ¶
func GetButtonWithTextOnyl ¶
type ButtonEventListener ¶
type ButtonEventListener interface { GetButton() int OnButtonUp() OnButtonDown() }
type Controller ¶
type Controller struct {
Id, Name string
Buttons map[int]float64
Mapper map[int]int
AxisStandard map[int]float64
AxisValues []float64
Down []int
SmartPhoneConn *SmartPhoneConn
// contains filtered or unexported fields
}
func (*Controller) GetAxisValue ¶
func (c *Controller) GetAxisValue(idx1, idx2 int) float64
func (*Controller) GetButtonValue ¶
func (c *Controller) GetButtonValue(idx int) float64
func (*Controller) GetInfos ¶
func (c *Controller) GetInfos() (out string)
func (*Controller) GetListenedBtns ¶
func (c *Controller) GetListenedBtns() []int
func (*Controller) LoadConfig ¶
func (c *Controller) LoadConfig(path string)
func (*Controller) RegisterButtonEventListener ¶
func (c *Controller) RegisterButtonEventListener(listener ButtonEventListener)
func (*Controller) RegisterDirectionEventListener ¶
func (c *Controller) RegisterDirectionEventListener(listener DirectionEventListener)
func (*Controller) ResetButtonEventListener ¶
func (c *Controller) ResetButtonEventListener()
func (*Controller) ResetDirectionEventListener ¶
func (c *Controller) ResetDirectionEventListener()
func (*Controller) SaveConfig ¶
func (c *Controller) SaveConfig(path string)
func (*Controller) SetMapper ¶
func (c *Controller) SetMapper(oldidx, newidx int)
func (*Controller) UpdateAll ¶
func (c *Controller) UpdateAll() (int, int)
func (*Controller) UpdateController ¶
func (c *Controller) UpdateController()
func (*Controller) UpdateControllerAll ¶
func (c *Controller) UpdateControllerAll()
func (*Controller) UpdateControllerButtons ¶
func (c *Controller) UpdateControllerButtons(buttons ...int)
func (*Controller) UpdateKeyBoard ¶
func (c *Controller) UpdateKeyBoard()
func (*Controller) UpdateKeyBoardAll ¶
func (c *Controller) UpdateKeyBoardAll()
func (*Controller) UpdateKeys ¶
func (c *Controller) UpdateKeys(keys ...int)
func (*Controller) UpdateListeners ¶
func (c *Controller) UpdateListeners()
func (*Controller) UpdateOnlyNeeded ¶
func (c *Controller) UpdateOnlyNeeded() (int, int)
func (*Controller) UpdateSmartPhone ¶
func (c *Controller) UpdateSmartPhone()
func (*Controller) UseCurrentAxisValsAsStandard ¶
func (c *Controller) UseCurrentAxisValsAsStandard()
type DirectionEventListener ¶
type ImageObj ¶
func GetBarChart ¶
func LoadImgObj ¶
func (*ImageObj) DrawImageObj ¶
func (*ImageObj) DrawImageObjAlpha ¶
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
func (*Params) LoadFromFile ¶
type Point ¶
type Point struct {
X, Y int
}
func CollidePnts ¶
func (*Point) CollidesWithPnt ¶
func (*Point) CollidesWithPnts ¶
func (*Point) CollidesWithWall ¶
func (*Point) IsContained ¶
type SmartPhoneConn ¶
type SmartPhoneConn struct { Enc string // contains filtered or unexported fields }
func (*SmartPhoneConn) EncToBool ¶
func (c *SmartPhoneConn) EncToBool()
func (*SmartPhoneConn) IsDown ¶
func (c *SmartPhoneConn) IsDown(i int) bool
func (*SmartPhoneConn) SetEnc ¶
func (c *SmartPhoneConn) SetEnc(enc string)
type SmartPhoneServ ¶
type SmartPhoneServ struct {
Cons *[]*Controller
}
var ( SPS_serv *SmartPhoneServ IpToStruct map[string]*SmartPhoneConn )
func NewSmartPhoneServ ¶
func NewSmartPhoneServ(cons *[]*Controller) (*SmartPhoneServ, string)
func (*SmartPhoneServ) Run ¶
func (s *SmartPhoneServ) Run()
type SnakeTiles ¶
type SnakeTiles struct {
Ts []*Point
}
func (*SnakeTiles) AddBack ¶
func (t *SnakeTiles) AddBack(xdir, ydir, tiles int)
func (*SnakeTiles) AddFront ¶
func (t *SnakeTiles) AddFront(xdir, ydir, tiles int)
func (*SnakeTiles) GetFirst ¶
func (t *SnakeTiles) GetFirst() *Point
func (*SnakeTiles) GetLast ¶
func (t *SnakeTiles) GetLast() *Point
func (*SnakeTiles) Print ¶
func (t *SnakeTiles) Print() string
func (*SnakeTiles) RemBack ¶
func (t *SnakeTiles) RemBack(tiles int)
func (*SnakeTiles) RemFront ¶
func (t *SnakeTiles) RemFront(tiles int)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.