graphic

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ANCHOR_BOTTOM int8 = 4
View Source
const ANCHOR_HORIZONTAL_MiDDLE = 2
View Source
const ANCHOR_LEFT int8 = 0

énumération des différentes ancres disponibles

View Source
const ANCHOR_RIGHT int8 = 1
View Source
const ANCHOR_TOP int8 = 3
View Source
const ANCHOR_VERTICAL_MiDDLE = 5

Variables

View Source
var (
	ErrOutOfRange = errors.New("colorconv: inputs out of range")
)

Functions

func DetectRectCollision

func DetectRectCollision(rect1 Rect, rect2 Rect) bool

retourne si les deux rectangles se chevauchent

func HSLToRGB

func HSLToRGB(h, s, l float64) (r, g, b uint8, err error)

Fonction convertissant les couleurs de format HSL en RGB.

func NewColorFromGradient

func NewColorFromGradient(offset float64, brightness float64) color.RGBA

retourne une couleur d'opacité 255 qui contient la couleur du cercle chromatique avec un certain offset, entre 0 et 360

Types

type Circle

type Circle struct {
	CenterPosition Vector2
	Radius         float32
}

func NewCircle

func NewCircle(radius float32, x float32, y float32) Circle

func (*Circle) DetectCircleCollision

func (c *Circle) DetectCircleCollision(otherCircle Circle) bool

Fonction permettant de détecter si deux Cercles se chevauchent

func (*Circle) DetectMouseCollision

func (c *Circle) DetectMouseCollision() bool

func (*Circle) DetectPointCollision

func (c *Circle) DetectPointCollision(position Vector2) bool

func (*Circle) DrawCross

func (c *Circle) DrawCross(color color.RGBA)

func (*Circle) DrawLines

func (c *Circle) DrawLines(color color.RGBA, LineAngle float32)

func (*Circle) Fill

func (c *Circle) Fill(color color.RGBA)

type Rect

type Rect struct {
	X      float32
	Y      float32
	Width  float32
	Height float32
}

func GetInnerHorizontalrect

func GetInnerHorizontalrect(sourceRect Rect, padding float32) Rect

même chose mais qu'avec les bords horizontaux

func GetInnerRect

func GetInnerRect(sourceRect Rect, padding float32) Rect

obtention d'un nouveau rectangle à l'intérieur d'un autre

func GetMouseRect

func GetMouseRect() Rect

retourne le rectangle de la souris

func GetWindowRect

func GetWindowRect() Rect

retourne le rectangle qui couvre la fenêtre

func NewRect

func NewRect(x float32, y float32, width float32, height float32) Rect

initialisation du rectangle

func NewRectFromVector

func NewRectFromVector(position Vector2, size Vector2) Rect

initialisation du rectangle avec deux vecteurs

func (Rect) Fill

func (r Rect) Fill(color color.RGBA, roundness float32)

draw the rectangle

type Shader

type Shader struct {
	Shader rl.Shader
	// contains filtered or unexported fields
}

func InitShader

func InitShader(shaderPath string) *Shader

func (*Shader) Begin

func (s *Shader) Begin()

func (*Shader) End

func (s *Shader) End()

func (*Shader) SetValueFromUniformName

func (s *Shader) SetValueFromUniformName(uniformName string, value any, uniformType rl.ShaderUniformDataType)

type Vector2

type Vector2 struct {
	X float32
	Y float32
}

objet contenant un vecteur qui a deux dimensions, qui peut représenter une position 2d, un déplacement 2d, et quelques méthodes pratiques

func GetRectCoordinatesWithAnchor

func GetRectCoordinatesWithAnchor(position Vector2, anchorX int8, anchorY int8, size Vector2, surfaceRect Rect) Vector2

func NewVector2

func NewVector2(x float32, y float32) Vector2

func (Vector2) Add

func (v Vector2) Add(otherVector Vector2) Vector2

func (Vector2) GetAngle

func (v Vector2) GetAngle() float64

func (Vector2) GetNorm

func (v Vector2) GetNorm() float32

func (Vector2) Scale

func (v Vector2) Scale(scale float32) Vector2

func (Vector2) ScaleToNorm

func (v Vector2) ScaleToNorm(norm float32) Vector2

func (Vector2) Substract

func (v Vector2) Substract(otherVector Vector2) Vector2

func (Vector2) ToRaylibVector2

func (v Vector2) ToRaylibVector2() rl.Vector2

Jump to

Keyboard shortcuts

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