• 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 the basic Scene2D 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

Instructions on how to format text on the Windows 11 notepad
Tips

Instructions on how to format text on the Windows 11 notepad

August 16, 2025
4 ways to fix bluetooth connectivity on Windows 11
Tips

4 ways to fix bluetooth connectivity on Windows 11

August 8, 2025
How to know the computer is tracked and processed by Keylogger
Tips

How to know the computer is tracked and processed by Keylogger

August 7, 2025
Opal: Create applications who do not need to write code
Tips

Opal: Create applications who do not need to write code

August 3, 2025
How to activate a new Start menu on Windows 11
Tips

How to activate a new Start menu on Windows 11

July 29, 2025
Intellgpt: AI tool for osint and data science
Tips

Intellgpt: AI tool for osint and data science

July 28, 2025
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

Instructions on how to format text on the Windows 11 notepad

Instructions on how to format text on the Windows 11 notepad

August 16, 2025
Instructions for receiving 80GB of free data from VinaPhone from August 15

Instructions for receiving 80GB of free data from VinaPhone from August 15

August 15, 2025
Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
How to add application to your favorite bar

How to add application to your favorite bar

August 14, 2025
Instructions on how to format text on the Windows 11 notepad

Instructions on how to format text on the Windows 11 notepad

August 16, 2025
Instructions for receiving 80GB of free data from VinaPhone from August 15

Instructions for receiving 80GB of free data from VinaPhone from August 15

August 15, 2025
Online driving exam preparation: Support theory and practice

Online driving exam preparation: Support theory and practice

August 15, 2025
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

Instructions on how to format text on the Windows 11 notepad

Instructions on how to format text on the Windows 11 notepad

August 16, 2025
Instructions for receiving 80GB of free data from VinaPhone from August 15

Instructions for receiving 80GB of free data from VinaPhone from August 15

August 15, 2025
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí mm88 8XBET mm88 trang chủ new88

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

©2024 AnonyVietFor Knowledge kqxs hôm nay xem phim miễn phí mm88 8XBET mm88 trang chủ new88

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