Documentation
¶
Overview ¶
Package ray is the managers.Device implementation using raylib
Index ¶
- type DeviceManagerImpl
- func (dmi DeviceManagerImpl) BeginFrame()
- func (dmi DeviceManagerImpl) BeginScissor(from geometry.Point, size geometry.Size)
- func (dmi DeviceManagerImpl) ChangeMusicVolume(musicDef components.MusicDef, volume float32)
- func (dmi DeviceManagerImpl) DrawBox(pos geometry.Point, box shapes.Box, solid color.Solid)
- func (dmi DeviceManagerImpl) DrawGradientBox(pos geometry.Point, box shapes.SolidBox, gradient color.Gradient)
- func (dmi DeviceManagerImpl) DrawLine(from, to geometry.Point, thickness float32, color color.Solid)
- func (dmi DeviceManagerImpl) DrawSolidBox(pos geometry.Point, box shapes.SolidBox, solid color.Solid)
- func (dmi DeviceManagerImpl) DrawSprite(def components.SpriteDef, sprite sprite.Sprite, pos geometry.Point, ...) error
- func (dmi DeviceManagerImpl) DrawText(ftd components.FontDef, txt ui.Text, pos geometry.Point, color color.Solid)
- func (dmi DeviceManagerImpl) End()
- func (dmi DeviceManagerImpl) EndFrame()
- func (dmi DeviceManagerImpl) EndScissor()
- func (dmi DeviceManagerImpl) GetFrameTime() float32
- func (dmi DeviceManagerImpl) GetMousePoint() geometry.Point
- func (dmi DeviceManagerImpl) GetScreenSize() geometry.Size
- func (dmi *DeviceManagerImpl) Init(opt options.Options)
- func (dmi DeviceManagerImpl) IsKeyPressed(key device.Key) bool
- func (dmi DeviceManagerImpl) IsKeyReleased(key device.Key) bool
- func (dmi DeviceManagerImpl) IsMousePressed(button device.MouseButton) bool
- func (dmi DeviceManagerImpl) IsMouseRelease(button device.MouseButton) bool
- func (dmi DeviceManagerImpl) LoadFont(fileName string) (components.FontDef, error)
- func (dmi DeviceManagerImpl) LoadMusic(fileName string) (components.MusicDef, error)
- func (dmi *DeviceManagerImpl) LoadSound(fileName string) (components.SoundDef, error)
- func (dmi DeviceManagerImpl) LoadTexture(fileName string) (components.TextureDef, error)
- func (dmi *DeviceManagerImpl) MeasureText(fnt components.FontDef, str string, size float32) geometry.Size
- func (dmi DeviceManagerImpl) PauseMusic(musicDef components.MusicDef)
- func (dmi DeviceManagerImpl) PlayMusic(musicDef components.MusicDef, volume float32)
- func (dmi *DeviceManagerImpl) PlaySound(soundDef components.SoundDef, volume float32)
- func (dmi DeviceManagerImpl) ResumeMusic(musicDef components.MusicDef)
- func (dmi *DeviceManagerImpl) SetBackgroundColor(color color.Solid)
- func (dmi *DeviceManagerImpl) SetMasterVolume(volume float32)
- func (dmi DeviceManagerImpl) ShouldClose() bool
- func (dmi *DeviceManagerImpl) StopAllSounds()
- func (dmi DeviceManagerImpl) StopMusic(musicDef components.MusicDef)
- func (dmi DeviceManagerImpl) UnloadFont(textureDef components.FontDef)
- func (dmi DeviceManagerImpl) UnloadMusic(musicDef components.MusicDef)
- func (dmi *DeviceManagerImpl) UnloadSound(soundDef components.SoundDef)
- func (dmi DeviceManagerImpl) UnloadTexture(textureDef components.TextureDef)
- func (dmi DeviceManagerImpl) UpdateMusic(musicDef components.MusicDef)
Constants ¶
This section is empty.
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 (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) DrawBox ¶ added in v0.1.8
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) 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) 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) 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) 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