Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

449
Visualizações
Unity Set position of GUI element relative to another element that is on a different canvas

I'm attempting to position a tooltip to be directly below an icon. The structure is:

Main Canvas
- Panel
 - UI Element
Tooltip Canvas
- Tooltip Icon

When mousing over an icon, I'm attempting to set the position of the tooltip to be just under the ui element. How does one get the absolute position of the ui element?

So far I've tried both

float absolute_x = icon.position.x;
or
float absolute_x = icon.anchoredPosition.x;

which only wield the relative position to the main canvas, not the absolute position on the UI.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

First get the Rectransform

public RectTransform UIElement;

then get position relative to the parent canvas

UIElement.localPosition.y
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda