imsfml

package module
v0.0.0-...-cf2382c Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 8 Imported by: 1

README

imsfml

Go Doc Go Report Card

ImGui+GoSFML2 binding, for use with imgui-go and a fork of gosfml2

Most of the code was based on imgui-sfml, usage is similar

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorToVec4

func ColorToVec4(col sf.Color) imgui.Vec4

ColorToVec4 converts sf.Color to imgui.Vec4

func FontTexture

func FontTexture() *sf.Texture

FontTexture returns the font texture

func Image

func Image(sprite *sf.Sprite, tintColor, borderColor sf.Color)

Image calls ImageTextureV(sprite.Texture, sprite.GetSize(), sprite.GetTextureRect(), tintColor, borderColor)

func ImageButton

func ImageButton(sprite *sf.Sprite, framePadding int, bgColor, tintColor sf.Color)

ImageButton calls ImageButtonTextureV(sprite.Texture, sprite.GetSize(), sprite.GetTextureRect(), framePadding, bgColor, tintColor)

func ImageButtonTextureV

func ImageButtonTextureV(texture *sf.Texture, size sf.Vector2f, textureRect sf.IntRect, framePadding int, bgColor, tintColor sf.Color) bool

ImageButtonTextureV calls imgui.ImageButtonV, with the parameters filled in as expected

func ImageTextureV

func ImageTextureV(texture *sf.Texture, size sf.Vector2f, textureRect sf.IntRect, tintColor, borderColor sf.Color)

ImageTextureV calls imgui.ImageV, with the parameters filled in as expected

func Init

func Init(displaySize imgui.Vec2, winHasFocus bool, createDefaultFont bool) (err error)

Init resets internal state, calling imgui.CreateContext. createDefaultFont controls whether or not to load the default font.

func InitRenderWindow

func InitRenderWindow(win *sf.RenderWindow, createDefaultFont bool) error

InitRenderWindow calls Init(win.GetSize(), win.HasFocus(), fontAtlas). createDefaultFont controls whether or not to load the default font.

func ProcessEvent

func ProcessEvent(e sf.Event)

ProcessEvent is to be called on every SFML Event received

func Render

func Render(win *sf.RenderWindow)

Render calls imgui.Render, and then draws the frame.

func Update

func Update(mousePos, displaySize imgui.Vec2, deltaT time.Duration)

Update updates the initial state, calling imgui.NewFrame. Call it before every frame.

func UpdateFontTexture

func UpdateFontTexture()

UpdateFontTexture uploads the font texture.

func UpdateRenderWindow

func UpdateRenderWindow(win *sf.RenderWindow, deltaT time.Duration)

UpdateRenderWindow calls Update(sf.Mouse.GetPosition(win), win.GetSize(), deltaT). It also updates the mouse cursor, which Update() does not. Call it before every frame.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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