Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inaccessible *ebiten.DrawImageOptions #22

Open
setanarut opened this issue Jan 14, 2024 · 8 comments
Open

inaccessible *ebiten.DrawImageOptions #22

setanarut opened this issue Jan 14, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@setanarut
Copy link

*ebiten.DrawImageOptions is the most important struct in ebitengine. It needs to be accessible to work with 2D camera systems.

https://github.com/yohamta/ganim8/blob/5328f97f11666ae6d0a2e570995835c25470462d/sprite.go#L161C15-L161C15

@yohamta yohamta added the enhancement New feature or request label Jan 14, 2024
@setanarut
Copy link
Author

setanarut commented Jan 15, 2024

Animation player should not be responsible for the screen drawing. It only needs to return *ebiten.Image with changing index.

for example:

func (g *Game) Draw(screen *ebiten.Image) {
	screen.DrawImage(animation.GetFrame(), MyDrawImageOptions)
}

@yohamta
Copy link
Owner

yohamta commented Jan 15, 2024

I completely agree with it, let’s discuss the new API. Maybe we could add it as separate interface and then clean up as v3. Currently, ganim8 is almost direct translation of love2d, so there could be a better design.

@yohamta yohamta closed this as completed Jan 15, 2024
@yohamta yohamta reopened this Jan 15, 2024
@yohamta
Copy link
Owner

yohamta commented Jan 15, 2024

Sorry my finger slipped

@setanarut

This comment was marked as off-topic.

@yohamta
Copy link
Owner

yohamta commented Jan 16, 2024

I would greatly appreciate if you could share the code of your animation library if you have written one. I was thinking that the
API of ganim8 needs to be improved anyway.

@yohamta
Copy link
Owner

yohamta commented Jan 17, 2024

Thanks for sharing the code. It looks really nice and solid. I might create a PR if there's anything I noticed.

@flamendless
Copy link

The link https://github.com/sokartes/ape does not work though

@setanarut
Copy link
Author

setanarut commented May 9, 2024

The link https://github.com/sokartes/ape does not work though

I deleted my second account, a more updated version is available at this link. https://github.com/setanarut/bulimia/blob/main/engine%2Fanimplayer.go

for static sprites just set frameCount=1. example is in bulimia game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants