Comments (9)
The examples do not have their own go.mod file. You can run them from the root of the project like:
PS C:\BirdMtnDev\Resources\ebitenui> go run ./_examples/widget_demos/button
PS C:\BirdMtnDev\Resources\ebitenui> go build ./_examples/widget_demos/button
PS C:\BirdMtnDev\Resources\ebitenui> ./button.exe
PS C:\BirdMtnDev\Resources\ebitenui>
Or if you use VS code there are run commands setup for each.
If you want to copy the code, you will need to build your go.mod file as needed.
from ebitenui.
This section of the error message you see is the key. You would need to run each of those "go get" commands.
main.go:7:2: no required module provides package github.com/ebitenui/ebitenui; to add it:
go get github.com/ebitenui/ebitenui
main.go:8:2: no required module provides package github.com/ebitenui/ebitenui/image; to add it:
go get github.com/ebitenui/ebitenui/image
main.go:9:2: no required module provides package github.com/ebitenui/ebitenui/widget; to add it:
go get github.com/ebitenui/ebitenui/widget
main.go:10:2: no required module provides package github.com/golang/freetype/truetype; to add it:
go get github.com/golang/freetype/truetype
main.go:11:2: no required module provides package github.com/hajimehoshi/ebiten/v2; to add it:
go get github.com/hajimehoshi/ebiten/v2
main.go:12:2: no required module provides package golang.org/x/image/font; to add it:
go get golang.org/x/image/font
main.go:13:2: no required module provides package golang.org/x/image/font/gofont/goregular; to add it:
go get golang.org/x/image/font/gofont/goregular
from ebitenui.
go get github.com/ebitenui/ebitenui
go get github.com/ebitenui/ebitenui/image
go get github.com/ebitenui/ebitenui/widget
go get github.com/golang/freetype/truetype
go get github.com/hajimehoshi/ebiten/v2
go get golang.org/x/image/font
go get golang.org/x/image/font/gofont/goregular
# go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/gamepad/api_linux.go:23:2: missing go.sum entry for module providing package golang.org/x/sys/unix (imported by github.com/hajimehoshi/ebiten/v2/internal/gamepad); to add:
go get github.com/hajimehoshi/ebiten/v2/internal/[email protected]
makes go build
work, but go mod tidy
after the above go get
ting does not:
> go mod tidy
domain.com/project/go/pkg/mod/github.com/davecgh/[email protected]/spew: import path "domain.com/project/go/pkg/mod/github.com/davecgh/[email protected]/spew" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/capjoin: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/capjoin" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/drawer: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/drawer" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/freetype: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/freetype" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/gamma: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/gamma" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/genbasicfont: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/genbasicfont" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/raster: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/raster" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/round: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/round" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/truetype: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]/example/truetype" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]/raster: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]/raster" should not have @version
domain.com/project/go/pkg/mod/github.com/golang/[email protected]/truetype: import path "domain.com/project/go/pkg/mod/github.com/golang/[email protected]/truetype" should not have @version
domain.com/project/go/pkg/mod/github.com/pmezard/[email protected]/difflib: import path "domain.com/project/go/pkg/mod/github.com/pmezard/[email protected]/difflib" should not have @version
Is this normal?
from ebitenui.
That is not normal. I don't know why you would be seeing an issue like that
from ebitenui.
Turns out it was user error. Project cannot be in home dir. Moving anywhere else fixes it.
from ebitenui.
Thank you for the update!
from ebitenui.
Okay, after digging some more, and sometimes reproducing issue outside of home dir, here is more details.
Min example
main.go
package main
import (
_ "github.com/ebitenui/ebitenui"
_ "github.com/hajimehoshi/ebiten/v2"
)
func main() {}
> mkdir project
> cd project
> # add main.go contents
> go clean -modcache
> rm -f go.md go.sum
> go mod init domain.com/project
> go mod tidy
go: finding module for package github.com/hajimehoshi/ebiten/v2
go: finding module for package github.com/ebitenui/ebitenui
go: downloading github.com/ebitenui/ebitenui v0.4.2
go: downloading github.com/hajimehoshi/ebiten v1.12.12
go: downloading github.com/hajimehoshi/ebiten/v2 v2.4.18
go: found github.com/ebitenui/ebitenui in github.com/ebitenui/ebitenui v0.4.2
go: found github.com/hajimehoshi/ebiten/v2 in github.com/hajimehoshi/ebiten/v2 v2.4.18
go: downloading github.com/hajimehoshi/file2byteslice v1.0.0
go: downloading github.com/jezek/xgb v1.1.0
go: downloading golang.org/x/mobile v0.0.0-20221110043201-43a038452099
go: downloading golang.org/x/sys v0.4.0
go: downloading github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b
go: downloading github.com/matryer/is v1.4.0
go: downloading github.com/stretchr/testify v1.8.1
go: downloading golang.org/x/image v0.3.0
go: downloading github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
go: downloading golang.org/x/exp/shiny v0.0.0-20230203172020-98cc5a0785f9
go: downloading github.com/ebitengine/purego v0.1.1
go: downloading github.com/hajimehoshi/bitmapfont/v2 v2.2.2
go: downloading golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/stretchr/objx v0.5.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading golang.org/x/text v0.6.0
domain.com/project imports
github.com/hajimehoshi/ebiten/v2 imports
github.com/hajimehoshi/ebiten/v2/internal/ui imports
golang.org/x/mobile/app imports
golang.org/x/exp/shiny/driver/gldriver: ambiguous import: found package golang.org/x/exp/shiny/driver/gldriver in multiple modules:
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 (/home/me/go/pkg/mod/golang.org/x/[email protected]/shiny/driver/gldriver)
golang.org/x/exp/shiny v0.0.0-20230203172020-98cc5a0785f9 (/home/me/go/pkg/mod/golang.org/x/exp/[email protected]/driver/gldriver)
domain.com/project imports
github.com/hajimehoshi/ebiten/v2 imports
github.com/hajimehoshi/ebiten/v2/internal/ui imports
golang.org/x/mobile/app imports
golang.org/x/exp/shiny/screen: ambiguous import: found package golang.org/x/exp/shiny/screen in multiple modules:
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 (/home/me/go/pkg/mod/golang.org/x/[email protected]/shiny/screen)
golang.org/x/exp/shiny v0.0.0-20230203172020-98cc5a0785f9 (/home/me/go/pkg/mod/golang.org/x/exp/[email protected]/screen)
> go build
main.go:4:2: no required module provides package github.com/ebitenui/ebitenui; to add it:
go get github.com/ebitenui/ebitenui
main.go:5:2: no required module provides package github.com/hajimehoshi/ebiten/v2; to add it:
go get github.com/hajimehoshi/ebiten/v2
To test, use this one-liner: go clean -modcache; rm -f go.mod go.sum; go mod init domain.com/project; go mod tidy; go build
Workaround
> # Retrieves ebiten/v2 (v2.4.16) instead of ebiten/v2 (v2.4.18)
> go get github.com/ebitenui/ebitenui
> # OR get ebiten/v2 (v2.4.18) directly, and add ebitenui from go mod tidy
> go get github.com/hajimehoshi/ebiten/v2; go mod tidy
go mod tidy
works after using one of the two above lines.
Cause (?)
ebitenui
depends on ebiten/v2
(v2.4.16), but ebiten/v2
(v2.4.16) conflicts with ebiten/v2
(v2.4.18).
Proposed fix
Upgrade ebitenui/go.mod
from ebiten/v2 v2.4.16
to ebiten/v2 v2.4.18
.
from ebitenui.
So I just released a new version that is based on ebitengine's newest release 2.5.0. I believe that should resolve your issue. Let me know. I'm planning on closing this ticket in a few days unless there are any concerns that come up.
from ebitenui.
No comments in the past month and a new version was released again v0.5.0. I am closing this issue. Please reopen if you still have concerns.
from ebitenui.
Related Issues (20)
- Move events handling to the Update tree HOT 1
- Tabbook should have a distinct hovered and activated states HOT 3
- FAQ bits collection HOT 1
- Friendlier messages when widget options are missing HOT 2
- SIGSEGV panic when no image is specified for a Button HOT 2
- Add ability to change focus in user defined directions
- Text input cursor is not at the end when text is updated through the code HOT 2
- TabBook: disabling the 1st tab works unexpectedly HOT 3
- AnchorLayout only shows a single child. HOT 6
- Android: Focusing a Text Input does not open Android on screen keyboard HOT 5
- Text Area does not render text on mobile
- Consider an ebitengine version decrease in the go.mod file HOT 1
- Centering a button HOT 2
- Cannot set button text position to TextPositionEnd HOT 3
- Broken ContextMenu HOT 2
- Support percentage widths on gridlayout
- Go 1.21.1 build WASM is broken HOT 6
- Feature request: Support for exp/textinput HOT 5
- Examples do not work on macOS 14.0 HOT 4
- Provide a click pos information for a ButtonClickedEventArgs when possible
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 ebitenui.