app

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package app provides a JS implementation of the github.com/mokiat/lacking/app package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config represents an application window configuration.

func NewConfig

func NewConfig(canvasID string) *Config

NewConfig creates a new Config object that contains the minimum required settings.

func (*Config) AddGLExtension

func (c *Config) AddGLExtension(name string)

AddGLExtension adds a new OpenGL extension that should be enabled when creating the OpenGL context.

func (*Config) AudioEnabled added in v0.18.0

func (c *Config) AudioEnabled() bool

AudioEnabled returns whether audio is enabled for this application.

func (*Config) Cursor added in v0.12.0

func (c *Config) Cursor() *app.CursorDefinition

Cursor returns the cursor configuration for this application.

func (*Config) CursorVisible added in v0.12.0

func (c *Config) CursorVisible() bool

CursorVisible returns whether the cursor will be shown when hovering over the window.

func (*Config) Fullscreen

func (c *Config) Fullscreen() bool

Fullscreen returns whether the application window will be displayed in fullscreen mode.

func (*Config) Height

func (c *Config) Height() int

Height returns the height of the application window.

func (*Config) SetAudioEnabled added in v0.18.0

func (c *Config) SetAudioEnabled(enabled bool)

SetAudioEnabled specifies whether audio should be enabled for this application.

func (*Config) SetCursor added in v0.12.0

func (c *Config) SetCursor(definition *app.CursorDefinition)

SetCursor configures a custom cursor to be used. Specifying nil disables the custom cursor.

func (*Config) SetCursorVisible added in v0.12.0

func (c *Config) SetCursorVisible(visible bool)

SetCursorVisible specifies whether the cursor should be displayed when moved over the window.

func (*Config) SetFullscreen

func (c *Config) SetFullscreen(fullscreen bool)

SetFullscreen specifies whether the application window should be displayed in fullscreen mode.

func (*Config) SetHeight

func (c *Config) SetHeight(height int)

SetHeight sets the height of the application window.

func (*Config) SetTitle

func (c *Config) SetTitle(title string)

SetTitle sets the title of the application window.

func (*Config) SetWidth

func (c *Config) SetWidth(width int)

SetWidth sets the width of the application window.

func (*Config) Title

func (c *Config) Title() string

Title returns the title of the application window.

func (*Config) Width

func (c *Config) Width() int

Width returns the width of the application window.

type Cursor added in v0.12.0

type Cursor struct {
	// contains filtered or unexported fields
}

func (*Cursor) Destroy added in v0.12.0

func (c *Cursor) Destroy()

type Gamepad added in v0.10.0

type Gamepad struct {
	// contains filtered or unexported fields
}

func (*Gamepad) ActionDownButton added in v0.10.0

func (g *Gamepad) ActionDownButton() bool

func (*Gamepad) ActionLeftButton added in v0.10.0

func (g *Gamepad) ActionLeftButton() bool

func (*Gamepad) ActionRightButton added in v0.10.0

func (g *Gamepad) ActionRightButton() bool

func (*Gamepad) ActionUpButton added in v0.10.0

func (g *Gamepad) ActionUpButton() bool

func (*Gamepad) BackButton added in v0.10.0

func (g *Gamepad) BackButton() bool

func (*Gamepad) Connected added in v0.10.0

func (g *Gamepad) Connected() bool

func (*Gamepad) DpadDownButton added in v0.10.0

func (g *Gamepad) DpadDownButton() bool

func (*Gamepad) DpadLeftButton added in v0.10.0

func (g *Gamepad) DpadLeftButton() bool

func (*Gamepad) DpadRightButton added in v0.10.0

func (g *Gamepad) DpadRightButton() bool

func (*Gamepad) DpadUpButton added in v0.10.0

func (g *Gamepad) DpadUpButton() bool

func (*Gamepad) ForwardButton added in v0.10.0

func (g *Gamepad) ForwardButton() bool

func (*Gamepad) LeftBumper added in v0.10.0

func (g *Gamepad) LeftBumper() bool

func (*Gamepad) LeftStickButton added in v0.10.0

func (g *Gamepad) LeftStickButton() bool

func (*Gamepad) LeftStickX added in v0.10.0

func (g *Gamepad) LeftStickX() float64

func (*Gamepad) LeftStickY added in v0.10.0

func (g *Gamepad) LeftStickY() float64

func (*Gamepad) LeftTrigger added in v0.10.0

func (g *Gamepad) LeftTrigger() float64

func (*Gamepad) Pulse added in v0.10.0

func (g *Gamepad) Pulse(intensity float64, duration time.Duration)

func (*Gamepad) RightBumper added in v0.10.0

func (g *Gamepad) RightBumper() bool

func (*Gamepad) RightStickButton added in v0.10.0

func (g *Gamepad) RightStickButton() bool

func (*Gamepad) RightStickX added in v0.10.0

func (g *Gamepad) RightStickX() float64

func (*Gamepad) RightStickY added in v0.10.0

func (g *Gamepad) RightStickY() float64

func (*Gamepad) RightTrigger added in v0.10.0

func (g *Gamepad) RightTrigger() float64

func (*Gamepad) SetStickDeadzone added in v0.10.0

func (g *Gamepad) SetStickDeadzone(deadzone float64)

func (*Gamepad) SetTriggerDeadzone added in v0.10.0

func (g *Gamepad) SetTriggerDeadzone(deadzone float64)

func (*Gamepad) StickDeadzone added in v0.10.0

func (g *Gamepad) StickDeadzone() float64

func (*Gamepad) Supported added in v0.10.0

func (g *Gamepad) Supported() bool

func (*Gamepad) TriggerDeadzone added in v0.10.0

func (g *Gamepad) TriggerDeadzone() float64

Jump to

Keyboard shortcuts

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