ray

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package ray is the managers.Device implementation using raylib

Index

Constants

View Source
const (
	GamepadAxisLeftX  = 0 // Left stick
	GamepadAxisLeftY  = 1 // Left stick
	GamepadAxisRightX = 2 // Right stick
	GamepadAxisRightY = 3 // Right stick
)

raylib axis

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceManagerImpl

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

DeviceManagerImpl is our managers.DeviceManager based on raylib

func New

func New() *DeviceManagerImpl

New create a new render.Render base on raylib

func (DeviceManagerImpl) BeginFrame

func (dmi DeviceManagerImpl) BeginFrame()

BeginFrame for rendering

func (DeviceManagerImpl) BeginScissor added in v0.1.9

func (dmi DeviceManagerImpl) BeginScissor(from geometry.Point, size geometry.Size)

BeginScissor start a scissor draw (define screen area for following drawing)

func (DeviceManagerImpl) ChangeMusicVolume added in v0.1.9

func (dmi DeviceManagerImpl) ChangeMusicVolume(musicDef components.MusicDef, volume float32)

ChangeMusicVolume change the given components.MusicDef volume

func (DeviceManagerImpl) DisableExitKey added in v0.1.10

func (dmi DeviceManagerImpl) DisableExitKey()

DisableExitKey will disable the exit key

func (DeviceManagerImpl) DrawBox added in v0.1.8

func (dmi DeviceManagerImpl) DrawBox(pos geometry.Point, box shapes.Box, solid color.Solid)

DrawBox draws a box outline with an color.Solid and a scale

func (DeviceManagerImpl) DrawGradientBox

func (dmi DeviceManagerImpl) DrawGradientBox(pos geometry.Point, box shapes.SolidBox, gradient color.Gradient)

DrawGradientBox draws a solid box with an color.Solid and a scale

func (DeviceManagerImpl) DrawLine added in v0.1.6

func (dmi DeviceManagerImpl) DrawLine(from, to geometry.Point, thickness float32, color color.Solid)

DrawLine between from and to with a given thickness and color.Solid

func (DeviceManagerImpl) DrawSolidBox

func (dmi DeviceManagerImpl) DrawSolidBox(pos geometry.Point, box shapes.SolidBox, solid color.Solid)

DrawSolidBox draws a solid box with an color.Solid and a scale

func (DeviceManagerImpl) DrawSprite

func (dmi DeviceManagerImpl) DrawSprite(def components.SpriteDef, sprite sprite.Sprite, pos geometry.Point, tint color.Solid) error

DrawSprite draws a sprite.Sprite in the given geometry.Point with the tint color.Color

func (DeviceManagerImpl) DrawText

func (dmi DeviceManagerImpl) DrawText(ftd components.FontDef, txt ui.Text, pos geometry.Point, color color.Solid)

DrawText will draw a text.Text in the given geometry.Point with the correspondent color.Color

func (DeviceManagerImpl) End

func (dmi DeviceManagerImpl) End()

End the rendering device

func (DeviceManagerImpl) EndFrame

func (dmi DeviceManagerImpl) EndFrame()

EndFrame for rendering

func (DeviceManagerImpl) EndScissor added in v0.1.9

func (dmi DeviceManagerImpl) EndScissor()

EndScissor end scissor

func (DeviceManagerImpl) GetFrameTime

func (dmi DeviceManagerImpl) GetFrameTime() float32

GetFrameTime returns the time from the delta time for current frame

func (DeviceManagerImpl) GetGamepadStickMovement added in v0.1.13

func (dmi DeviceManagerImpl) GetGamepadStickMovement(gamePad int32, stick device.GamepadStick) geometry.Point

GetGamepadStickMovement return the movement, -1..1, for a given gamepad stick

func (DeviceManagerImpl) GetMousePoint

func (dmi DeviceManagerImpl) GetMousePoint() geometry.Point

GetMousePoint returns the current Point of the mouse

func (DeviceManagerImpl) GetScreenSize

func (dmi DeviceManagerImpl) GetScreenSize() geometry.Size

GetScreenSize get the current screen size

func (*DeviceManagerImpl) Init

func (dmi *DeviceManagerImpl) Init(opt options.Options)

Init the rendering device

func (DeviceManagerImpl) IsGamepadAvailable added in v0.1.13

func (dmi DeviceManagerImpl) IsGamepadAvailable(gamePad int32) bool

IsGamepadAvailable indicates if the game pad number is available

func (DeviceManagerImpl) IsGamepadButtonPressed added in v0.1.13

func (dmi DeviceManagerImpl) IsGamepadButtonPressed(gamePad int32, button device.GamepadButton) bool

IsGamepadButtonPressed returns if given gamepad button is pressed

func (DeviceManagerImpl) IsGamepadButtonReleased added in v0.1.13

func (dmi DeviceManagerImpl) IsGamepadButtonReleased(gamePad int32, button device.GamepadButton) bool

IsGamepadButtonReleased returns if given gamepad button is released

func (DeviceManagerImpl) IsKeyPressed added in v0.1.6

func (dmi DeviceManagerImpl) IsKeyPressed(key device.Key) bool

IsKeyPressed returns if given device.Key is pressed

func (DeviceManagerImpl) IsKeyReleased added in v0.1.6

func (dmi DeviceManagerImpl) IsKeyReleased(key device.Key) bool

IsKeyReleased returns if given device.Key is released

func (DeviceManagerImpl) IsMousePressed added in v0.1.6

func (dmi DeviceManagerImpl) IsMousePressed(button device.MouseButton) bool

IsMousePressed check if the given MouseButton has been pressed

func (DeviceManagerImpl) IsMouseRelease

func (dmi DeviceManagerImpl) IsMouseRelease(button device.MouseButton) bool

IsMouseRelease check if the given MouseButton has been release

func (DeviceManagerImpl) LoadFont

func (dmi DeviceManagerImpl) LoadFont(fileName string) (components.FontDef, error)

LoadFont giving it file name into VRAM

func (DeviceManagerImpl) LoadMusic

func (dmi DeviceManagerImpl) LoadMusic(fileName string) (components.MusicDef, error)

LoadMusic giving it file name into memory

func (*DeviceManagerImpl) LoadSound

func (dmi *DeviceManagerImpl) LoadSound(fileName string) (components.SoundDef, error)

LoadSound giving it file name into memory

func (DeviceManagerImpl) LoadTexture

func (dmi DeviceManagerImpl) LoadTexture(fileName string) (components.TextureDef, error)

LoadTexture giving it file name into VRAM

func (*DeviceManagerImpl) MeasureText

func (dmi *DeviceManagerImpl) MeasureText(fnt components.FontDef, str string, size float32) geometry.Size

MeasureText return the geometry.Size of a string with a defined size and spacing

func (DeviceManagerImpl) PauseMusic

func (dmi DeviceManagerImpl) PauseMusic(musicDef components.MusicDef)

PauseMusic pauses the given components.MusicDef

func (DeviceManagerImpl) PlayMusic

func (dmi DeviceManagerImpl) PlayMusic(musicDef components.MusicDef, volume float32)

PlayMusic plays the given components.MusicDef

func (*DeviceManagerImpl) PlaySound

func (dmi *DeviceManagerImpl) PlaySound(soundDef components.SoundDef, volume float32)

PlaySound plays the given components.SoundDef

func (DeviceManagerImpl) ResumeMusic

func (dmi DeviceManagerImpl) ResumeMusic(musicDef components.MusicDef)

ResumeMusic resumes the given components.MusicDef

func (*DeviceManagerImpl) SetBackgroundColor

func (dmi *DeviceManagerImpl) SetBackgroundColor(color color.Solid)

SetBackgroundColor changes the current background color.Solid

func (DeviceManagerImpl) SetExitKey added in v0.1.10

func (dmi DeviceManagerImpl) SetExitKey(key device.Key)

SetExitKey will set the exit key

func (*DeviceManagerImpl) SetMasterVolume added in v0.1.9

func (dmi *DeviceManagerImpl) SetMasterVolume(volume float32)

SetMasterVolume change the master volume

func (DeviceManagerImpl) ShouldClose

func (dmi DeviceManagerImpl) ShouldClose() bool

ShouldClose returns if th engine should close

func (*DeviceManagerImpl) StopAllSounds

func (dmi *DeviceManagerImpl) StopAllSounds()

StopAllSounds currently playing

func (DeviceManagerImpl) StopMusic

func (dmi DeviceManagerImpl) StopMusic(musicDef components.MusicDef)

StopMusic stop the given components.MusicDef

func (DeviceManagerImpl) UnloadFont

func (dmi DeviceManagerImpl) UnloadFont(textureDef components.FontDef)

UnloadFont from VRAM

func (DeviceManagerImpl) UnloadMusic

func (dmi DeviceManagerImpl) UnloadMusic(musicDef components.MusicDef)

UnloadMusic giving it file from memory

func (*DeviceManagerImpl) UnloadSound

func (dmi *DeviceManagerImpl) UnloadSound(soundDef components.SoundDef)

UnloadSound giving it file from memory

func (DeviceManagerImpl) UnloadTexture

func (dmi DeviceManagerImpl) UnloadTexture(textureDef components.TextureDef)

UnloadTexture from VRAM

func (DeviceManagerImpl) UpdateMusic

func (dmi DeviceManagerImpl) UpdateMusic(musicDef components.MusicDef)

UpdateMusic update the stream of the given components.MusicDef

Jump to

Keyboard shortcuts

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