Skip to main content

Posts

Showing posts from June, 2020

[Godot Engine] How to set a game to center in multi resolution screens

The Godot engine has many layout options to fit the game to multi-resolution screens. You can use  one of default options , if you don't want to fill the full screen with the game or you allow to change the ratio of the game screen. However, Using only default options, it's not so easy to set elements in the game to proper position with fill the multi resolution screen and keep the ratio of the width and height of the game. the requirements are as follows: The background have to fill the multi resolution screens. The elements in the game have to properly positioned with the size of screen. There might be many way to solve this problem, but I'll show you the simplest way what i think and tried. 1. Separate the background and contents in the game. Separate the background and contents in the game. Fill the screen using the background and resize and reposition the contents. Create a new scene and name

[Godot engine] How to set the AnimatedTexture to the TextureButton node

In the Godot engine, the TextureButton can use a variety of textures. In this post, I'll show how to set an AnimatedTexture to the TextureButton node. The AnimatedTexture shows an animation effect using the image frames. To do this, I prepared simple images as a frames of the animation. I create a "images" folder to save the images. Godot engine have to import these images to use. The importing is done by drag and drop.  Add TextureButton node to the Scene. The texture list to set will be shown when you select inserted TextureButton, expand Textures menu in Inspector tab in right side of editor. I'll set AnimatedTexture in the Normal case, because I want to show text animation all the time. I Selected "[empty]" drop box beside Normal and select "New AnimatedTexture" menu. There are 5 imag

[C#] Detect and close a specific popup window.

When you need to detect and close a specific window, you can do using AddAutomationEventHandler  method in the namespace System.Windows.Automation.  Set Hook line 4, set identifier for window open event which want to detect. line 7, set event handler   Set Event Handler line 8, compare name of element with the name to find. line 15, print the contents of the window line 22, find the "No" button, it's name has a character "N". line 24~25, push the button.