system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
potatobanana |
i try to change position to position i want, but didn’t work.
i want it at middle position2D
here video to my problem https://youtu.be/_vmWoZROydc
here my code
func _on_tower_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
if event is InputEventMouseButton:
if event.is_pressed():
print("click shop")
$testPopup.rect_global_position = $pop_pos.global_position
$testPopup.popup(
system
2
|
|
|
|
Reply From: |
payload505 |
see this video might help
system
3
|
|
|
|
Reply From: |
jgodfrey |
I think you want this:
$testPopup.rect_position = $pop_pos.position
i get right position for both in print() , but even i change pivot_offset, it still use 0,0 pivot_offset, like in the video show.
i want it popup at middle Position2D
why this happend?
how should i fix it?
here my code $testPopup.rect_position = $pop_pos.position
my popup at (0,0)
node
potatobanana | 2020-03-17 05:07