ray

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package ray the implementation of render.Render for raylib

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RenderImpl

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

RenderImpl is our render.Render based on raylib

func New

func New() *RenderImpl

New create a new render.Render base on raylib

func (RenderImpl) BeginFrame

func (rr RenderImpl) BeginFrame()

BeginFrame for rendering

func (RenderImpl) DrawGradientBox

func (rr RenderImpl) DrawGradientBox(pos geometry.Point, box shapes.Box, gradient color.Gradient)

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

func (RenderImpl) DrawSolidBox

func (rr RenderImpl) DrawSolidBox(pos geometry.Point, box shapes.Box, solid color.Solid)

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

func (RenderImpl) DrawSprite

func (rr RenderImpl) 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 (RenderImpl) DrawText

func (rr RenderImpl) 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 (RenderImpl) End

func (rr RenderImpl) End()

End the rendering device

func (RenderImpl) EndFrame

func (rr RenderImpl) EndFrame()

EndFrame for rendering

func (RenderImpl) GetFrameTime

func (rr RenderImpl) GetFrameTime() float32

GetFrameTime returns the time from the delta time for current frame

func (RenderImpl) GetKeyStatus

func (rr RenderImpl) GetKeyStatus(key device.Key) device.KeyStatus

GetKeyStatus returns the device.KeyStatus for a given device.Key

func (RenderImpl) GetMousePoint

func (rr RenderImpl) GetMousePoint() geometry.Point

GetMousePoint returns the current Point of the mouse

func (RenderImpl) GetScreenSize

func (rr RenderImpl) GetScreenSize() geometry.Size

GetScreenSize get the current screen size

func (*RenderImpl) Init

func (rr *RenderImpl) Init(opt options.Options)

Init the rendering device

func (RenderImpl) IsMouseRelease

func (rr RenderImpl) IsMouseRelease(button device.MouseButton) bool

IsMouseRelease check if the given MouseButton has been release

func (RenderImpl) LoadFont

func (rr RenderImpl) LoadFont(fileName string) (components.FontDef, error)

LoadFont giving it file name into VRAM

func (RenderImpl) LoadTexture

func (rr RenderImpl) LoadTexture(fileName string) (components.TextureDef, error)

LoadTexture giving it file name into VRAM

func (*RenderImpl) MeasureText

func (rr *RenderImpl) 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 (*RenderImpl) SetBackgroundColor

func (rr *RenderImpl) SetBackgroundColor(color color.Solid)

SetBackgroundColor changes the current background color.Solid

func (RenderImpl) ShouldClose

func (rr RenderImpl) ShouldClose() bool

ShouldClose returns if th engine should close

func (RenderImpl) UnloadFont

func (rr RenderImpl) UnloadFont(textureDef components.FontDef)

UnloadFont from VRAM

func (RenderImpl) UnloadTexture

func (rr RenderImpl) UnloadTexture(textureDef components.TextureDef)

UnloadTexture from VRAM

Jump to

Keyboard shortcuts

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