Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello! There is no proper ui component in Superpowers. But you can manage to do it like so:

let camera = Sup.getActor("Camera").camera;
let mousePosition = Sup.Input.getMousePosition();
let ray = new Sup.Math.Ray().setFromCamera(camera, mousePosition);
let result = ray.intersectActor(Sup.getActor("Button"));
if (result.length > 0) {
  // Hovering the button

  if (Sup.Input.wasMouseButtonJustPressed(0)) {
    // Just clicked on the button
  }

} else {
  // Not hovering the button
}

Hope it helps!