I have basically an "error" or "yaar" type of node that I have tried dropping into the node tree in the editor, and instantiating via code. Either way, when I ask it to slide from below the bottom of the screen (y=bottom of screen) to the bottom area of the screen (y=bottom of screen - box height), this works on the desktop, but fails on iOS. On iOS I have to arbitrarily offset the landing spot 600 pixels up on the screen.
I am hoping an expert might see some fatal problem with this code:
var loc = calculateSlideIn(correctFeedback)
var tween = get_node("Tween")
tween.interpolate_property(correctFeedback, "rect_global_position",
loc.start, loc.end, 0.4,
Tween.TRANS_EXPO, Tween.EASE_OUT)
func calculateSlideIn(n):
var screenHeight = OS.window_size.y
var start = Vector2(0, screenHeight)
var end = Vector2(0, screenHeight - n.rect_size.y)
print("slide in from ", start, " to ", end, " size: ", n.rect_size, " visible: ", n.visible)
return {"start":start, "end":end}
There is a 120pixel safe area on the top of my iPhone, but it's too small of an offset to matter here as far as I can tell.
i.e. if the panel is 220 pixels heigh, and the device is 1200 pixels high, it slides from y=1200 to y=980. And works on the desktop. On my phone I just take off another 600 and all of a sudden I can see it.