How to REMOVE Title Bar

How to REMOVE Title Bar???

yes, you can set the title of the canvas window

void setup() {
  size(300, 300);
  surface.setTitle("hallo world");
}
1 Like

It used to be surface.setUndecorated(), but I believe that it is now

void setup() {
     fullscreen();
     surface.setSize(600,400); //Change size here
}
2 Likes

i see this: works here

also @Quillbert1 does same.

void setup() {
  fullScreen();
  surface.setSize(200, 200); //Change size here
}

void draw() {
  background(0);
  ellipse(mouseX, mouseY, 20, 20);
}

2 Likes

thank you?
but, can’t move it?
How to make movable and resizable Window With screen fit…!?..

and with custom title bar.

play with this,
and find some info:

mod with @Quillbert1 ( next post )

void setup() {
  size(200, 200);
  surface.setTitle("my title");
  surface.setResizable(true);
  surface.setLocation(200,200);
  println("move or resize window per mouse, reset with any keypress");
}

void draw() {
  ellipse(width/2,height/2,width/4,width/4);
}

void keyPressed() {
  surface.setSize(200,200);
  surface.setLocation(200,200);
}

2 Likes

You can move it with surface.setLocation()

1 Like

Hey! :blush: You could also consider using globalMouse from java.awt like the one below to move the surface.

import java.awt.*;

int gMouseX = 0, gMouseY = 0;  // g for global
float screenPosX, screenPosY, factorX, factorY; // Movement factor

void settings() {
  fullScreen();
}
void setup() {
  surface.setSize(400, 200);
  screenPosX = (displayWidth - width)/2;     // Positioning window in the center
  screenPosY = (displayHeight - height)/2;
}
void draw () {  
  background(30);

  textAlign(CENTER, CENTER);
  textSize(height*0.1);
  text("Ethiopia", width/2, height/2);

  globally ();
}
void globally () {
  surface.setLocation((int) screenPosX, (int) screenPosY);
  
  Point location = MouseInfo.getPointerInfo().getLocation();
  gMouseX = (int) location.getX();  // global mouse position along X
  gMouseY = (int) location.getY();  // global mouse position along Y
}
void mousePressed() {
  factorX = mouseX;
  factorY = mouseY;
}
void mouseDragged() {
  screenPosX = MouseInfo.getPointerInfo().getLocation().x - factorX;
  screenPosY = MouseInfo.getPointerInfo().getLocation().y - factorY;
}

Regards.

2 Likes

Awesome…:blush:
Thank you…

But How to make it fit to screen?

To fit to the screen, just call fullScreen().

1 Like