Function to get current font size (needed it)
-
- Posts: 814
- Joined: Tue Apr 09, 2013 12:23 pm
- My devices: iPhone,iPad
Windows - Location: Groningen, Netherlands
- Flag:
Function to get current font size (needed it)
def font_size = (text_width("0123456789")-1)/6
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Function to get current font size (needed it)
Very smart function!
Next release will have such function built-in.
It was interesting to compare speed of this user function wih built-in function.
User function performs 100000 times in 1.727 seconds.
Built-in function in 0.269 seconds.
Next release will have such function built-in.
It was interesting to compare speed of this user function wih built-in function.
User function performs 100000 times in 1.727 seconds.
Built-in function in 0.269 seconds.
Re: Function to get current font size (needed it)
Yes, there's excellent performance in Smart Basic. Great accuracy on sprite collisions also.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Function to get current font size (needed it)
Nice to hear that!Dr zayus wrote:Yes, there's excellent performance in Smart Basic. Great accuracy on sprite collisions also.