#Transform input from a ViewportTexture to a SubViewport

7 messages · Page 1 of 1 (latest)

reef totem
#

Hey everyone, I am trying to forward mouse inputs on a TextureRect with a ViewportTexture to its corresponding SubViewport that has a 2D scene and Camera2D as children.
I am forwarding the input with the following code on the TextureRect and my inputs do reach the SubViewport:
func _input(event: InputEvent) -> void: if event is InputEventMouse: viewport.push_unhandled_input(mouse_event)
However the input is obviously scaled and translated wrong and that is the part that I am struggling with.
Any help would be greatly appreciated

clear harness
reef totem
#

Would love to do that, however, you cannot scale SubViewportContainers below the SubViewport size. I have multiple textures in a layout and I use ratio stretch to resize them dynamically

clear harness
reef totem
#

Ah sorry, I have seen that post before and tried that implementation, but it does not work correctly

clear harness
#

Is the scaling or offset incorrect or does it just not work in general