ebiten

package
v0.0.0-...-7f92c57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL