Comments (9)
Looking at code more Batch seems to me like Canvas...
from engo.
I have first success to render a sprite.
https://github.com/matiwinnetou/engi/commit/7a3bab3e9adcb294b7b5425fa62c08d818fbca16
I wrote own method:
in assets.go
func (s *Sprite) Render(b *Batch, render *RenderComponent, space *SpaceComponent) {
b.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)
}
probably totally wrong but first success :)
from engo.
@matiwinnetou Hey. I'm not too much of a fan of gitter, I would much prefer IRC. Join me on #engi
on freenode if you wish.
from engo.
OK. I've updated the examples to reflect the latest API changes. If you want, you could look through #20. Everything there will compile.
from engo.
Thx, this is appreciated.
I will try to contribute to this project since I have a vision how to improve something and fix problem which I am facing now. Before I do that I will explain you what problem I see at the moment and what is limiting me to write my Galaxian game example.
It seems that the way spritesheets are implemented is that they need to be in a specific order. I can see that some spritesheets not only are not associated with one but multiple sprites but also are not "predictable" and characters and some frames of animation are distributed in somewhat chaotic manner on PNG file. While one could demand to cut such PNG and convert this to a particular order, I think it may be relatively easier to modify code in a way in which Spritesheet could handle also somewhat "chaotic spritesheet pngs". In such case it would be necessary to pass list or array of regions because only manually one would be able at the moment to allocate regions to a spritesheet but at the moment this is not even possible. I would like to develop a prototype.
In addition I think Region type should be either renderable or we should refactor old Sprite type to make it renderable and remove fields, which are no longer needed since they are in SpaceComponent and RenderComponent.
I have some mega proof of concept code running locally in which I can already render successfully Region types using ECS.
I don't get one thing though, how in AnimationComponent it is even possible to value from a sprite sheet will be allocated in constructor? The only constructor or rather factory method which I can see is:
// Create a new pointer to AnimationComponent
func NewAnimationComponent() *AnimationComponent {
return &AnimationComponent{Animations: make(map[string][]int)}
}
How this can possibly work or is this code in progress?
What do you think in general?
from engo.
@matiwinnetou This all seems like a reasonable idea... But I do not think we should have multiple ways to do the same thing. In all honesty the Sprite
struct is legacy and should be removed. And it would make sense for Region
's to be Renderable
.
I've actually been planning to refractor Animation{Component,System}
for a while. So please, go ahead... I totally broke the ECS design while writing that thing.
from engo.
I'd really like to see these changes in a PR (preferably seperately).
from engo.
We can track these problems in #21 and #4
from engo.
Close please.
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.