• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

Basic operations on Scene2D – basic Godot Engine

AnonyViet by AnonyViet
November 12, 2024
in Tips
0

Hi! Hello friends! In today's article, I continue to share with you basic operations on Scene2D (2-dimensional space working window) on Godot Engine! Without further ado, let's get to the article! Let's go!

Join the channel Telegram belong to AnonyViet 👉 Link 👈

SCENE2D WORK WINDOW

To work on the Scene 2D window, select 2D Mode:Basic operations on Scene2D

We will then see the Scene 2D working window as follows:

How to use Scene2D godot engine

– At the top is the Scene name

– Below is the toolbar to manipulate objects in the Scene

– The bottom is the main working screen of a Scene including:

+ Oxygen coordinate axis

+ Viewport 2D (2D viewport)

Oxygen coordinate axis (on Godot Engine)

– Is a line of two perpendicular lines intersecting at a point O (O is taken as the center and is called the coordinate angle)

+ A straight line lying horizontally from a straight and frontal perspective is called the abscissa (horizontal axis, x axis, cos axis) with length from left to right respectively

(-oo;+oo)

+ The straight line lying vertically from a straight and frontal perspective is called the ordinate (Vertical axis, Y axis, Sin axis) whose length from top to bottom is (-oo;+oo) respectively.

+ The unit of the coordinate angle O is (0,0)

Scene2D user manual

  • Object A is placed on the Oxy axis system (A must be visible objects such as Node2D, Spatical, Control,… does not apply to white Nodes and control Nodes)

– For example, we apply a certain object A to this Oxy coordinate system. Suppose Basic operations on the basic Scene2D Godot Engineis an object. Then we bring it Basic operations on the basic Scene2D Godot EngineInto the Oxygen system, it will generate a position and a size corresponding to the system of type Vector2(x unit, y unit)

– Vector2 is a data type that represents positions in 2D space

Basic operations on the basic Scene2D Godot Engine

– Godot position on the x axis is 5 units, on the y axis is 0 units up to the center of the object

– Godot dimensions on the x and y axes are 2 units based on the distance from the start point to the end point of length and width.

– We can briefly represent the position and size of Godot using Vector2() as follows:

#Godot.position = Vecto2(5,0)

#Godot.scale = Vecto2(2,2)

The object can rotate its center (rotation).

Basic operations on the basic Scene2D Godot Engine

We have A, B, C with each different rotation direction calculated in degrees (0->360°)

– We can change position, scale, rotation_degree in the Transform section of the object's properties (Inspector).

Basic operations on the basic Scene2D Godot Engine

Stackable objects (Zindex)

Basic operations on the basic Scene2D Godot Engine

Because we are using 2D Mode, which is a frontal view, we will not see the Z axis, but we can change the Zindex index so that the objects stack on top of each other in this view direction.

Basic operations on the basic Scene2D Godot Engine

We can find Zindex in the Node properties.

Objects can change their display (Visiblity)

  • Hidden and visible (visible)

Basic operations on the basic Scene2D Godot Engine

Godot is showing

Objects can be hidden/shown through Node's eye icon (if available).

Basic operations on the basic Scene2D Godot Engine

Godot is hidden

Basic operations on the basic Scene2D Godot Engine

Godot is showing

CanvasItem

  • Nodes displayed on the 2D Mode window are called a CanvasItem

Basic operations on the basic Scene2D Godot Engine

Illustration of 3 CanvasItems

Operations on CanvasItem

– Select a CanvasItem (Select Mode)

Basic operations on the basic Scene2D Godot Engine

Click the mouse icon on the Scene toolbar then left click on the CanvasItem you want to select. Or click on the Node corresponding to that CanvasItem.

Basic operations on the basic Scene2D Godot Engine

You can also select multiple CanvasItems by using the key combination available on the HDH you are using. (Similar to selecting multiple files).

Basic operations on the basic Scene2D Godot Engine

Click Move Mode. Then hold down the left mouse button on the object and drag and drop. Or click on the object and use the navigation keys to move.

  • Resize CanvasItem

Basic operations on the basic Scene2D Godot Engine

In select mode. Click and hold the red dots around the object and drag and drop. This will change the scale value

Basic operations on the basic Scene2D Godot Engine

Or you can drag the x and y scale axes in scale mode.

Basic operations on the basic Scene2D Godot Engine

In Rotate Mode, click and hold on the object and drag to rotate.

  • Change the CanvasItem's center (pivot).

Basic operations on Scene2D – basic Godot Engine

Select Change rotation rotation mode -> Lick and hold the position icon on the CanvasItem and drag and drop to the desired position.

  • Change the CasvaItem view position

Basic operations on the basic Scene2D Godot Engine

Click Pan Mode -> Lick and hold an empty area on the Scene 2D window and drag and drop to the desired area. Or click and hold the right mouse button and mouse wheel when not using Pan Mode.

  • Measure CanvasItem size.

Basic operations on the basic Scene2D Godot Engine

Select Ruler Mode (triangle), click, hold and drag and drop the areas to be measured.

  • CanvasItem move key

Basic operations on the basic Scene2D Godot Engine

To avoid selecting the wrong objects, you use lock object mode by selecting an object that needs to be locked, clicking the lock tube icon on the scene toolbar. You can unlock it by clicking that icon again. Or click the Node lock icon in the Scene Tree.

Basic operations on the basic Scene2D Godot Engine

Or you can lock the movement of all child Nodes of the object by clicking Lock object's children.

  • Set smart location with snapping

Basic operations on the basic Scene2D Godot Engine

You can move the object position more precisely with snapping magnets. It will help you suggest the margins of other objects so you can place the object more accurately.

Note: Observe the settings for Node

Basic operations on the basic Scene2D Godot Engine

  • The green frame is Type Node (type of Node)
  • Pink: Node name
  • 1: Node is warning
  • 2: Node is already using Signal (is emitting a signal)
  • 3: Node has been assigned a script
  • 4: Node has been locked to move
  • 5: The locked Node moves its child Nodes
  • 6: Node is being displayed in Scene 2D
  • Viewport 2D (2D Viewport)

– What is Viewport?

  • Viewport roughly translates as viewport, which is the user's visible area of ​​content in a game.
  • Viewport on Scene 2D:

Basic operations on the basic Scene2D Godot Engine

You can see the blue blurred border, that is Godot's 2D Viewport frame. The default resolution when creating a project is 1240×600.

  • All objects visible when running the game must be placed in this viewport
  • The game's root node has a default Type of Viewport

Basic operations on the basic Scene2D Godot Engine

  • The top left corner of the default Viewport frame will coincide with the O coordinate angle
  • Viewport will be different for different devices, and will be smaller on mobile phones than on computer screens.
  • So how can the game display well on devices?

Set up Viewport

  • Change Viewport size (Screen size)

– Most smartphones and laptops currently have FullHD screens. So we will take FullHD as the standard (up to you)

Basic operations on the basic Scene2D Godot Engine

Project -> Project settings

Basic operations on the basic Scene2D Godot Engine

At Display -> Window. Then set the resolution again to FullHD (1920×1080) 16:9.

– Please turn on Hidpi for devices that support this mode for better display.

Basic operations on the basic Scene2D Godot Engine

We can find the Hidpi section at Display -> Window

  • Set Viewport Scale

Basic operations on the basic Scene2D Godot Engine

Also in Display -> Window section in project settings. We find the Strect section and set:

+ Mode is: 2d if you focus on gui design. Viewport will support display with better resolution but not suitable for gui.

+ Aspect is:

  • ignore: always fills when changing window scale
  • keep_wight: keep horizontal ratio
  • keep_height: keep height ratio
  • keep: keep the whole screen aspect ratio
  • expand: fills screens with the same ratio

After the above viewport settings, your Game will display content well on devices.

Note: Please set up the viewport first when starting to make a game! To avoid display errors

– Set rotation direction for devices with automatic rotation sensor:

Basic operations on the basic Scene2D Godot Engine

At Display -> Window in Project settings. Find Handheld -> Orientation.

  • Select landscape if the screen is rotated horizontally.
  • Select portrait if you want the screen to rotate vertically
  • If the machine has an automatic rotation sensor, select items with sensors.

In today's article, I introduced and shared with you basic operations on Scene2D on Godot Engine. If you have any questions, please leave a comment or suggestion! To better understand, you can refer to the basic videos at https://www.youtube.com/playlist?list=PLOk8LhtEwUVn8e3RUfk-rX_RB3f9_ulYg. Thank you for following the article! 🙂

Previous Post

[Lập Trình Game] Lesson 13: Collect items in Godot Engine

Next Post

Can't call on Messenger? Fix it now with a few simple steps!

AnonyViet

AnonyViet

Related Posts

Try the Shopee Profit Calculator now, avoid the risk of selling at a loss
Tips

Try the Shopee Profit Calculator now, avoid the risk of selling at a loss

May 19, 2026
Prompt converts photos into extremely impressive children’s drawings
Tips

Prompt converts photos into extremely impressive children’s drawings

May 17, 2026
Instructions for receiving 1 month of ChatGPT Plus for free
Tips

Instructions for receiving 1 month of ChatGPT Plus for free

May 12, 2026
How to get ChatGPT Business 48 months discount from only 0 VND
Tips

How to get ChatGPT Business 48 months discount from only 0 VND

May 9, 2026
How to create a tiny version of yourself to follow the trend very easily
Tips

How to create a tiny version of yourself to follow the trend very easily

May 9, 2026
How to get 500GB pCloud for free, Swiss standard cloud storage
Tips

How to get 500GB pCloud for free, Swiss standard cloud storage

May 8, 2026
Next Post
Can't call on Messenger? Fix it now with a few simple steps!

Can't call on Messenger? Fix it now with a few simple steps!

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

Try the Shopee Profit Calculator now, avoid the risk of selling at a loss

Try the Shopee Profit Calculator now, avoid the risk of selling at a loss

May 19, 2026
LibreOffice: Office suite to replace Microsoft Office

LibreOffice: Office suite to replace Microsoft Office

May 18, 2026
ONLYOFFICE: Free Microsoft Office alternative

ONLYOFFICE: Free Microsoft Office alternative

May 18, 2026
Prompt converts photos into extremely impressive children’s drawings

Prompt converts photos into extremely impressive children’s drawings

May 17, 2026
Try the Shopee Profit Calculator now, avoid the risk of selling at a loss

Try the Shopee Profit Calculator now, avoid the risk of selling at a loss

May 19, 2026
LibreOffice: Office suite to replace Microsoft Office

LibreOffice: Office suite to replace Microsoft Office

May 18, 2026
ONLYOFFICE: Free Microsoft Office alternative

ONLYOFFICE: Free Microsoft Office alternative

May 18, 2026
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

Try the Shopee Profit Calculator now, avoid the risk of selling at a loss

Try the Shopee Profit Calculator now, avoid the risk of selling at a loss

May 19, 2026
LibreOffice: Office suite to replace Microsoft Office

LibreOffice: Office suite to replace Microsoft Office

May 18, 2026
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply