Allow a sprite to be the drag handle for an empty-widget (or something else that helps?)

Things that we aren't going to implement
Post Reply
User avatar
Godmave
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Tue Nov 15, 2016 3:52 pm
Contact:

Allow a sprite to be the drag handle for an empty-widget (or something else that helps?)

Post by Godmave »

I would like the user to be able to click and drag around the hud in https://mods.factorio.com/mod/vehiclehud

The code would look somewhat like this:

Code: Select all

    local gui = player.gui.screen.add({
        type = "empty-widget",
        name = "vehiclehud"
    })
...

    local face = gui.add{
        type = "sprite",
        name = "vehiclehud-face",
        sprite = "vehiclehud-face-300"
    }

face.drag_target = gui

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Allow a sprite to be the drag handle for an empty-widget (or something else that helps?)

Post by Rseding91 »

I made every widget type that supports having a drag target set support it in the Lua API. Sprites do not support having drag targets set at the widget level.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Won't implement”