#If the Factorio API doesn't allow to

1 messages ยท Page 1 of 1 (latest)

fickle jewel
#

Also since I created something that can draw anything in the gui I did this... don't ask me why... I was bored..

brave fjord
#

Oh? Are you using the camera trick?

fickle jewel
#

yes

#

I made something like html/js canvas

brave fjord
#

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)

fickle jewel
#

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

brave fjord
#

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?

fickle jewel
#

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

brave fjord
#

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 :/

fickle jewel
#

tho it would be really awesome to have access to the current player's cursor position

brave fjord
#

Best you can get is what they have "selected", but that's in world

fickle jewel
brave fjord
#

Just force the user to use an auto clicker, duh /s

fickle jewel
#

x)

lethal thistle
#

If it has a graphics, it needs to play bad apple

dusk kettle
#

E.g. when they click

fickle jewel
dusk kettle
#

Sure

sharp locust
#

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

polar sparrow
fickle jewel
polar sparrow
lethal thistle
# polar sparrow 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:/...

โ–ถ Play video
polar sparrow
#

Oh I think I actually have seen that one

hardy bane