I hereby claim:
- I am vitefalcon on github.
- I am vitefalcon (https://keybase.io/vitefalcon) on keybase.
- I have a public key whose fingerprint is 2083 9BF8 5A07 0C70 DC0B 1B51 96FD ABFB 2440 8428
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I wanted to start building the GUI parts of the game, but create it in such a way that I will have a network interface that I can later replace with the actual implementation.
I created a LoginClient
that provides an interface to the login server functions. This client works in an asynchronous manner. Login requests gets queued, which then gets processed by a thread. The fun part was in the details, which I will explain here.
I feel this is one of the things that has been least documented in Godot's documentation and few people in Godot's Discord channel have knowledge of how this works.
The general code to create and run a method in a thread looks like this:
extends Node | |
var array | |
var size | |
var start = 0 | |
var end = -1 | |
var mutex = Mutex.new() | |
signal item_removed |
<?xml version="1.0"?> | |
<resources> | |
<location type="dir" path="C:/Users/vitefalcon/Games/WoonReloaded_Full/"/> | |
<location type="grf" path="C:/Users/vitefalcon/Games/WoonReloaded_Full/WRO.grf"/> | |
<location type="grf" path="C:/Users/vitefalcon/Games/WoonReloaded_Full/rdata.grf"/> | |
<location type="grf" path="C:/Users/vitefalcon/Games/WoonReloaded_Full/data.grf"/> | |
</resources> |
// create a camera to set up the projection and model view matrices, and the subgraph to draw in the HUD | |
osg::ref_ptr<osg::Camera> camera = new osg::Camera(); | |
// set the view matrix | |
camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF); | |
// use identity view matrix so that children do not get (view) transformed | |
camera->setViewMatrix(osg::Matrix::identity()); | |
// set the projection matrix to be of width and height of 1 | |
camera->setProjectionMatrix(osg::Matrix::ortho2D(0, 1.0f, 0, 1.0f)); | |
// set resize policy to fixed |
namespace Component | |
{ | |
extern const char* HEALTH; | |
extern const char* NAME; | |
} | |
template <const char* Name, typename T> | |
class Attribute | |
{ | |
private: |