Comments (5)
Yes we do! Unfortunately, there isn't very much documentation... The component/system are in this file: https://github.com/paked/engi/blob/master/animation.go
If you need any help give me a shout!
from engo.
👍
BTW: it would be nicer if we had a Gitter channel, I am already signed by default to my work slack channel and Gitter is perfect for these things.
I already could comment on some things I encountered while browsing through the code.
from engo.
I am trying the most simple sprite to work, I realized that *Region is renderable but Sprite is not really. Well there is a render method implemented but only a method that takes a *Batch. If I pass this to
engi.NewRenderComponent(
it doesn't work because sprite cannot be rendered...
I modified tilemap example to play with latest API:
package main
import (
"fmt"
"github.com/paked/engi"
"log"
)
var World *GameWorld
type GameWorld struct {
engi.World
}
func (game *GameWorld) Preload() {
engi.Files.Add("data/Hero.png")
log.Println("Preloaded")
}
func (game *GameWorld) Setup() {
engi.SetBg(0x2d3739)
game.AddSystem(&engi.RenderSystem{})
sprites := engi.NewSpritesheet("Hero.png", 15, 15)
cell := sprites.Cell(1)
println(fmt.Sprintf("%f", sprites.Height()))
println(fmt.Sprintf("%f", sprites.Width()))
gameMap := engi.NewEntity([]string{"RenderSystem"})
mapRender := engi.NewRenderComponent(cell, engi.Point{1, 1}, "map")
mapSpace := engi.SpaceComponent{engi.Point{100, 100}, 0, 0}
gameMap.AddComponent(&mapRender)
gameMap.AddComponent(&mapSpace)
game.AddEntity(gameMap)
}
func main() {
World = &GameWorld{}
engi.Open("Hello", 1024, 640, false, World)
}
so far no luck to be able to use one tile from the tilemap
from engo.
there are these methods:
func NewSprite(region *Region, x, y float32) *Sprite {
return &Sprite{
Position: &Point{x, y},
Scale: &Point{1, 1},
Anchor: &Point{0, 0},
Rotation: 0,
Color: 0xffffff,
Alpha: 1,
Region: region,
}
}
func (s *Sprite) Render(batch *Batch) {
batch.Draw(s.Region, s.Position.X, s.Position.Y, s.Anchor.X, s.Anchor.Y, s.Scale.X, s.Scale.Y, s.Rotation, s.Color, s.Alpha)
}
but I cannot render a sprite...
from engo.
@matiwinnetou Can you push the code to (a branch of) your fork? Then I could take a look? (easier when we're using the same code).
from engo.
Related Issues (20)
- Update isometric demo to use tiles of different sizes
- WSL to build on windows
- Shape drawing problem HOT 7
- Circle fill transparency HOT 6
- About performance HOT 7
- Scale operation seems to move the entity to the wrong position
- shader
- Support WebGL and Android HOT 11
- TMX resources cannot handle tile sets that leave a rest at end of rows HOT 2
- TMX resources don't respect transformations when loading tiles
- Build on macos M1 / Apple Silicon fails (GL/mobile-related) HOT 2
- AudioSystem's Pause and Restart aren't working
- Question: Can you draw upon a transparent window/canvas? HOT 1
- Cannot Compile on m1 mac HOT 3
- Release v1.0.7 appears to be tagged incorrectly HOT 1
- Properly handle gifs
- Add function to disable cursor HOT 1
- quadtree to fast
- Do not use icon.png as default image.
- MacOS 11 removed from test runners
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from engo.