Using camera() and displaying pin up things

Hi people; I’m starting using camera(…) and don’t understand well looking the reference or other topics :dizzy_face:

I want to change the camera but let some buttons/text in the front lane without moving (to be able to touch them) :point_left:.

Also, the begincamera() and endCamera() don’t see are doing something… works the same with it and without…

well, this is an example about what I would like, and what I have:

float circleX;
int flag;


void setup(){
size(displayWidth,displayHeight,P3D);
circleX = 50;
}
void draw(){
  background(50);
  fill(255);
  
  text("hello",100,100);
  ellipse(100,180,24,24);

   camera(mouseX, mouseY, (float)(height/2.0) / tan((float) (PI*30.0 / 180.0)),
                    (float)(width/2.0), (float)(height/2.0), 0, 0, 1, 0);
  translate(circleX,500);
  sphere(100);
  
  if(circleX >= displayWidth-24){
    flag=1;
  }
  if(circleX <= 24){
    flag=0;
  }
  if(flag==1)
    circleX = circleX-1;
    else
    circleX = circleX+1;
}

Want the text and the ellipse, to stay static in the same position (like if the ellipse would be a button) :four_leaf_clover:. Like an HUD.

Thanks, any help would be appreciated :hugs:.

1 Like

Move the HUD at end of draw

Simply say

camera();

text(…

2 Likes

@Chrisir Thanks , I had translations and rotations in my main code and now I don’t need it, is totally fine, thank you so much :heart:

1 Like