Replies: 2 comments 14 replies
-
This sounds like how to use go:embed. If go:embed succeeds, you no longer have to care about the location of your resources, right? I'm not sure what failed in your second attempt. |
Beta Was this translation helpful? Give feedback.
-
Hi, i am also interested in this topic. I have created a simple card game that's running on Mac and WebAssembly. All work fine so far. Now I want to try doing an IOS Build but struggling with warnings and error messages.
GLKit.framework is present at mentioned path..... when looking into the "GLKit.framework" folder ... the header file is there.. with using the parameter "-iosversion 12.0" the notes about 'statusBarOrientation' can be suppressed.... I am not skilled with building IOS Applications nor Xcode etc... have no clue what to do now.... Any Tips are welcome thx Michael |
Beta Was this translation helpful? Give feedback.
-
Inspired by the ebitenmobile document, i set out to turn a simple desktop playground into adesktop/mobile monorepo.
Disclaimer, I've only just learnt golang in the last few days.
1. First Attempt
Starting with the ebiten-aseprite/example directory, I attempted to reproduce it running on my android phone.
mobile.go
as described by the blog post.ebitenmobile bind ...
command😢 No success
ebitenutil.NewImageFromFile
being undefined or something?gomobile install -tags=example github.com/hajimehoshi/ebiten/v2/examples/paint
works2. Second Attempt
So I thought maybe the errors about
ebitenutil.NewImageFromFile
being undefined are something to do with a filesystem problem.So I looked at what https://github.com/hajimehoshi/go-inovation was doing with regards to loading sprites.
I noticed it was there was some relationship between something called
embed
, some magic comments and how they were accessed.I set out to replicate that.
But first I split the repo into more of a monorepo structure.
cmd/ desktop/ main.go pkg/ game/ assets/ images/ *.png/json/aseprite core/ aseprite.go images.go game.go
I added the mobile cmd according to the ebitenmobile document
cmd/ desktop/ main.go mobile/ mobile.go pkg/ game/ assets/ assets.go 🗨️ images/ *.png/json/aseprite core/ aseprite.go images.go game.go
result: https://github.com/airtonix/golang-ebiten-multiplatform-aseprite-monorepo/tree/1491c44
😢 No success
gomobile install ./cmd/mobile
errors, complaining it can't find an apk3. Third Attempt
So from my experience that is react-native on ios and android, my next thought was that I need to provide all the ugly and boring files that android studio and xcode like to magically generate 🤮 .
So i proceeded to copy what ever was in the
android
dir from https://github.com/hajimehoshi/go-inovation, replacing any app id references in file contents or file/folder namesI end up with
gomobile install ./cmd/mobile
works and now I have an app on my phone... but it just hangs when i launch it and have to force kill it.Conclusion
So this is where I'm at.
I'll be coming back to this to understand more about what's required.
However, it might be worth updating the ebitenmobile document to mention that nothing will work until the user provides the
android
andios
project files generated by respective android and ios tools.My other thought was to provide a generator that could make use of https://github.com/StephanHCB/go-generator-cli/ to quickly scaffold these two directories.
Beta Was this translation helpful? Give feedback.
All reactions