#If the Factorio API doesn't allow to
1 messages ยท Page 1 of 1 (latest)
Also since I created something that can draw anything in the gui I did this... don't ask me why... I was bored..
Oh? Are you using the camera trick?
With your experience with it, can you display a GUI within the camera?
I've been (trying) to make a library that'll handle as much of the GUI stuff for you as I can. The plan was to also add a visual editor that'll have a preview so you can test your designs faster as well as make it simpler for those afraid of GUI code.
While that's a future question, I'm just currently a little stalled by dev block as I want to make instantiable elements but I'm struggling to think how to do it in the very static output of the visual editor (that is still theoretical)
yes you just gotta do camera.add({...})
I was planning to use that to be able to click on the image, by making a grid of invisible button elements in the camera. Tho I'm not sure it's a good idea because it will probably make some lag if I create a really large image that uses for example 1920x1080 buttons
maybe a way of registering locations to listen for clicks in?
It would be a departure from the JavaScript canvas you're recreating, but hacks upon hacks, right?
maybe I can use on_gui_hover and on_gui_leave to make a grid of button around the cursor when it's in the image and I could move that grid as the cursor leaves and enters the buttons to follow it so I only have to create a few thousand buttons instead of millions
but that's way too complicated so I won't do it
oh wait nvm the on_gui_click event has a cursor_display_location
so I can probably use that
Wait it does!?
I guess I haven't ever needed that so I didn't notice
And I was about to say there's no hover, but I was thinking of the focus events I made a forum request to exist and act like the hover events :/
tho it would be really awesome to have access to the current player's cursor position
Best you can get is what they have "selected", but that's in world
to recreate the white cross and the tooltip of vanilla graphs
Just force the user to use an auto clicker, duh /s
x)
bad apple when
If it has a graphics, it needs to play bad apple
You can get it from a custom input
E.g. when they click
Yeah I meant having access to it at all times, not only when they a click
Sure
well what you could do is put an invisible grid over your gui and listen for "raise_hover_events", but yea you'd need lots of points to make it accurate, maybe just have invisible gui's over important/interesting graph points
Doomtorio when? ๐
Someone already did with combinators
of course they did
Facto-RayO is a 3D game-engine I made in #Factorio 1.1, in v2.1 I've added a UI. The doom UI to be specific, including view-models.
you can download the save file here: [todo factorio forum link]
previous versions: https://www.youtube.com/playlist?list=PLxR_6RD8er_3esLidLgC5SjpHlkVScJfZ
some explanatory videos (not specific to v2.1): https:/...
Oh I think I actually have seen that one
What do you mean by the camera trick, any information on how I can draw custom thing like js canvas ?