Update examples
This commit is contained in:
parent
ab3ade6210
commit
317e9eea6a
3 changed files with 11 additions and 8 deletions
|
@ -47,7 +47,7 @@ func main() {
|
|||
numSamples = samplesLeft
|
||||
}
|
||||
|
||||
rl.UpdateAudioStream(stream, data[totalSamples-samplesLeft:], numSamples)
|
||||
rl.UpdateAudioStream(stream, data[totalSamples-samplesLeft:])
|
||||
|
||||
samplesLeft -= numSamples
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/gen2brain/raylib-go/easings"
|
||||
"github.com/gen2brain/raylib-go/raygui"
|
||||
"github.com/gen2brain/raylib-go/raylib"
|
||||
rl "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -21,8 +23,8 @@ func main() {
|
|||
|
||||
ballPosition := rl.NewVector2(startPositionX, float32(screenHeight)/2)
|
||||
|
||||
comboActive := 0
|
||||
comboLastActive := 0
|
||||
comboActive := int32(0)
|
||||
comboLastActive := int32(0)
|
||||
|
||||
easingTypes := []string{"SineIn", "SineOut", "SineInOut", "BounceIn", "BounceOut", "BounceInOut", "BackIn", "BackOut", "BackInOut"}
|
||||
ease := easingTypes[comboActive]
|
||||
|
@ -75,7 +77,7 @@ func main() {
|
|||
rl.ClearBackground(rl.RayWhite)
|
||||
|
||||
raygui.Label(rl.NewRectangle(20, 20, 200, 20), "Easing Type:")
|
||||
comboActive = raygui.ComboBox(rl.NewRectangle(20, 40, 200, 20), easingTypes, comboActive)
|
||||
comboActive = raygui.ComboBox(rl.NewRectangle(20, 40, 200, 20), strings.Join(easingTypes, ";"), comboActive)
|
||||
|
||||
raygui.Label(rl.NewRectangle(20, 80, 200, 20), "Press R to reset")
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/gen2brain/raylib-go/raylib"
|
||||
"log"
|
||||
|
||||
rl "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
func main() {
|
||||
rl.SetTraceLogCallback(func(logType int, str string) {
|
||||
level := ""
|
||||
switch logType {
|
||||
switch rl.TraceLogLevel(logType) {
|
||||
case rl.LogDebug:
|
||||
level = "Debug"
|
||||
case rl.LogError:
|
||||
|
@ -22,7 +23,7 @@ func main() {
|
|||
case rl.LogFatal:
|
||||
level = "Fatal"
|
||||
}
|
||||
if logType != rl.LogFatal {
|
||||
if rl.TraceLogLevel(logType) != rl.LogFatal {
|
||||
log.Printf("%s - %s", level, str)
|
||||
} else {
|
||||
log.Fatalf("%s - %s", level, str)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue