I'm getting back at doing some cg images (fractals, flam3, attractors, raytracing, etc...) as a hobby, and I would like to use a simple window for displaying purposes instead of blindly generating images to disk and then checking the result, it will make debugging and playing way easier.
I'm in need of a very simple (small and fast) library to display a window and have access to any form of
setPixel(x, y, color) within that window. This usually come in 2D gaming libraries or as canvas widgets on GUI libraries, but as a backend developer I have not played with those in a long time.
My only needs are:
From googling around and checking awesome-go I found some possible candidates, but I have found the community always gives the best non-biased advice (usually) when it comes to recommendations.
Right now I'm thinking of using fyne as it checks most of my needs, but I'm leaning towards going back to using GLFW just because its battle tested and it's kinda familiar. One thing worth mentioning is that some of the CG images are CPU heavy and heavily multithreaded, so keeping the main window thread snappy and responsive while the rest of the routines do the heavy lifting is a must.
Edit: For now I'm using pixel (https://github.com/faiface/pixel)! Seems small and portable enough (and uses GLFW as the OpenGL backend), but I will try other suggestions. Also attached simple DeJong attractors animation I produced with it, I'm looking at some better (and performant) coloring functions to go with it, this is just logarithmic density, but looks good enough for a test and runs fast.
... keep reading on reddit ➡
#lang racket/gui (define bcg (read-bitmap "C:/Users/black/Desktop/Uni block 2 project/background.png")) (define bcg2 (read-bitmap "C:/Users/black/Desktop/Uni block 2 project/bcg.png")) (define logo (read-bitmap "C:/Users/black/Desktop/Uni block 2 project/logo.jpg")) (define aatylw (read-bitmap "C:/Users/black/Desktop/Uni block 2 project/aatyellow2.png")) (define aatgreen (read-bitmap "C:/Users/black/Desktop/Uni block 2 project/aatgreen.png")) (define aatblue (read-bitmap "C:/Users/black/Desktop/Uni block 2 project/aatblue2.png")) (define aatred (read-bitmap "C:/Users/black/Desktop/Uni block 2 project/aatred2.jpg")) (define frame (new frame% (width 600) (height 337) (label "Tank Wars: The Last Tankwalker") )) (define rulepage (new frame% (width 300) (height 100) (label "Tank Wars: Rules of the Game") (stretchable-height #f))) (define rulepanel (new horizontal-panel% (parent rulepage) (min-height 300) (min-width 100) [stretchable-height #f] [stretchable-width #f] (alignment '(center center)))) (new message% (parent rulepanel) (min-height 100) (min-width 300) (vert-margin 100) (label "Tank Trouble is tank game where you drive in a maze and shoot missiles at your enemies. Player 1 plays with WASD-keys for driving and Q for shooting. Player 2 uses the arrow keys and space.")) (define backbtn (new button% (parent rulepage) (label "Back to Main Menu") (callback (λ (button event) (and (send rulepage show #f) (send frame show #t)))))) (define gamebtn (new button% (parent rulepage) (label "Start the Game") (callback (λ (button event) (and (send rulepage show #f) (send frame2 show #t)))))) (define frame2 (new frame% (width 600) (height 600) (label "Tank Wars: The Last Chooseyourplayerwalker"))) (define panel (new vertical-panel% (parent frame)))
I'm starting making some web games with HTML5 Canvas, and I have done pretty good so far on my first game. I now need to make a popup GUI, and instead of making a bunch of dumb inefficient code, I thought I'd ask the pros. How do you make GUIs?
EDIT: Sorry for the title, I meant coder.
disabling the gameobjects themselves is not an option as i need to keep their behavior running, i only want to hide them from view but culling doesnt seem to work for it
I'm looking to get something up and running kind of quick, with the ability to add more features down the line. I've dealt with Tkinter but nothing else, and have never dealt with canvas/drawing widgets in any regard.
Learning isn't the issue, but being able to 1) Get a quick prototype and 2) Easily adding more features (layers? Masking? Grid lines? Cursor snap?) are priorities.
Ninja edit: I consider myself pretty advanced in Python usage, but pretty mediocre when it comes to GUI stuff. Almost everything I've done has been either a command line tool or django related.
I'm fine working in Python 2 and 3 but I doubt that will matter.
Hi guys, i need some help here. What i wish to make is something like in this picture: http://i.imgur.com/OzInBdy.jpg The first image is an example of the gui, and the second image is the effect i want when the gui is overlaped by the window that appears. I thought i could create this effect simply by tweking the depth of field effect on the camera, but aparently i can't. I'm guessing it has something to do with the way the canvas is rendered preventing what i want to achieve. Now i'm not sure how to aproach this, if it's possible at all.
I have a switch statement with 5 different cases and each case displays a slightly different menu. in each case theres 3 buttons that are the same no matter what but they will be a different height position depending on which case they are.. Then depending on which case it is if its case 1 then there will be a fourth menu button.. if there is case 2 then 5 menu buttons.
How do I do this in new canvas system? It was easy to do in old way of writing the gui in the code.
Hi, I am trying to implement a GUI for my game entirely from scratch (no Swing except for the Canvas). So far I have implemented the rendering of 4 basic elements (Label, button, text field, and a selection element). I can't figure out how to properly handle inputs though. I know I can use keyboard listeners, etc..., but I can't find a good way to do it.
Imagine the following, written in another language (e.g. C#/WinForms), user interface: http://i.imgur.com/bBzl5Tr.png
Could I make the canvas renderer be Rust code (.dll/.so) using glium? I'm worried about glium being a context owner... I would not like to own the canvas. The main application could use the canvas for whatever purposes when it's not drawing with the Rust library, even use another library.
For instance, there's a library for rendering format X (with Rust) and another for format Y, the main app just gives the filename to the library and on each tick asks for that library to render the data on the canvas. The main application may be even responsible for rendering format Z.
I have a partially transparent canvas element in world space attached with various text/panel and other things provided by unity do develop UIs.
My problem is that when the player walks behind the UI the text is backwards. Obviously the easiest fix would be a collider that flips the text, but that is dodgy as sometimes the player could step towards the UI activate the collider and then move back and the text would be flipped.
I was wondering if any of you guys had a simple way to do this, I was thinking of using a vector to detect which side of the canvas the player is on then flip it based on that. But I'm not too sure how to implement it properly.
Any help would be appreciated, thanks.
I do not need advanced graphics but more for flowcharts and the like (so simple shapes, text, connectors etc). As an example, xfig is an awesome tool for this, but it only exports to SVG, not canvas.
Hi guys, i need some help here. What i wish to make is something like in this picture: http://i.imgur.com/OzInBdy.jpg
The first image is an example of the gui, and the second image is the effect i want when the gui is overlaped by the window that appears.
I thought i could create this effect simply by tweking the depth of field effect on the camera, but aparently i can't. I'm guessing it has something to do with the way the canvas is rendered preventing what i want to achieve.
Now i'm not sure how to aproach this, if it's possible at all.