Comments (3)
So for drawing SVG, Couldn't you render the SVG to an image object (not the screen) like in the example you linked. Then use that image with ebitenui?
from ebitenui.
Awesome! Thanks so much! I had no idea I could do that!
I added these to images.go
func createTriangle(size int, c color.Color) *ebiten.Image {
// Create a new image of the desired size
img := ebiten.NewImage(size, size)
// Get the RGBA values of the color
r, g, b, a := c.RGBA()
// Iterate over the pixels in the image
for y := 0; y < size; y++ {
for x := 0; x < size; x++ {
// If the pixel is within the bounds of the triangle, set its color
if x >= y && x < size-y {
img.Set(x, y, color.RGBA{uint8(r), uint8(g), uint8(b), uint8(a)})
}
}
}
return img
}
func createTriangeDown(size int) *widget.ButtonImageImage {
// Create the images
triangleIdle := createTriangle(size, primaryColor)
triangleDisabled := createTriangle(size, secondaryColor)
// Return the ButtonImageImage
return &widget.ButtonImageImage{
Idle: triangleIdle,
Disabled: triangleDisabled,
}
}
Then, just replaced arrowDown
with this arrowDown := createTriangeDown(15)
and it worked great!
Now, there is a dropdown triangle that is rendered on the fly.
from ebitenui.
That's great!, I am going to close this issue for now. Please feel free to reach out if you have any further questions.
-Mark
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 4
- 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.