Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Suggestion: GetSize() method for IObject

Here you can find ScriptAPI suggestions implemented in the game.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Suggestion: GetSize() method for IObject

Post by JakSparro98 » Sun Apr 16, 2017 5:46 pm

In addition to the "GetSizeFactor" method I would suggest a "GetSize" Method to get the actual size we already see when we hover the mouse on a tile in map editor.
A possible implementation could return a Point type when the first number is the width and the second is the height.

With only GetSizeFactor we cannot always extract the correct size of the shape, this happens, for instance, when we have some tile that isn't 8x8 (eg. Sandbags tiles, pool table tile ,ect).
6 x

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Fri Apr 28, 2017 6:34 pm

Nice suggestion. Adding it to the next update (Alpha v.1.3.0). There will be IObject.GetBaseSize() and IObject.GetSize().
GetBaseSize() will return the tile's base size without the size factor. GetSize() will return the current size of the object (BaseSIze * SizeFactor).
5 x
Gurt

Locked