Back to godoc.org

Package ebiten

v0.0.0-...-2704a23
Latest Go to latest

The latest major version is .

Published: 2 days ago | License: GPL3 | Module: github.com/OpenDiablo2/OpenDiablo2

Overview

Package ebiten provides graphics and input API to develop a 2D game.

Index

type InputService

type InputService struct{}

InputService provides an abstraction on ebiten to support handling input events

func (InputService) CursorPosition

func (is InputService) CursorPosition() (x, y int)

CursorPosition returns a position of a mouse cursor relative to the game screen (window).

func (InputService) InputChars

func (is InputService) InputChars() []rune

InputChars return "printable" runes read from the keyboard at the time update is called.

func (InputService) IsKeyJustPressed

func (is InputService) IsKeyJustPressed(key d2enum.Key) bool

IsKeyJustPressed checks if the provided key is just transitioned from up to down.

func (InputService) IsKeyJustReleased

func (is InputService) IsKeyJustReleased(key d2enum.Key) bool

IsKeyJustReleased checks if the provided key is just transitioned from down to up.

func (InputService) IsKeyPressed

func (is InputService) IsKeyPressed(key d2enum.Key) bool

IsKeyPressed checks if the provided key is down.

func (InputService) IsMouseButtonJustPressed

func (is InputService) IsMouseButtonJustPressed(button d2enum.MouseButton) bool

IsMouseButtonJustPressed checks if the provided mouse button is just transitioned from up to down.

func (InputService) IsMouseButtonJustReleased

func (is InputService) IsMouseButtonJustReleased(button d2enum.MouseButton) bool

IsMouseButtonJustReleased checks if the provided mouse button is just transitioned from down to up.

func (InputService) IsMouseButtonPressed

func (is InputService) IsMouseButtonPressed(button d2enum.MouseButton) bool

IsMouseButtonPressed checks if the provided mouse button is down.

func (InputService) KeyPressDuration

func (is InputService) KeyPressDuration(key d2enum.Key) int

KeyPressDuration returns how long the key is pressed in frames.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier