Jump to content
Sign in to follow this  
Laksekjønn

bitmapFont

Recommended Posts

In SmartMS, there's an interesting unit called "SmartCL.BitmapFont". Indeed it is a RetroFont unit. A retro font is similar to a BitmapFont, in that it uses a texture to render the text. However unlike a BitmapFont, every character in a RetroFont is the same size, you typically find font sheets like this from old 8/16bit-games. 

The following project uses the RetroFont idea, the font is stored/encoded as base64 in main.js, you don't have an extra HTTP request, at least.

//rawgit.com/smartpascal/smartms/master/games/BitmappedText/www/preview.html

but what is really missing in SMS is a true bitmap Font unit! bitmap text objects work by taking a texture file and a .XML or JSON file that describes the font structure. It the generates a new sprite object for each letter of the text, proportionally spaced out and aligned to match the font structure. 

a new version of the BitmapFont unit would be so nice.

In my experimental project,  I'm having performance issues due to the volume of sprites being rendered, I having unexpected results between browsers when rendering dynamic texts, static texts that don't require to be constantly updating, it seems to be working fine. hum, I have to implement multi lines textures. 

Share this post


Link to post
Share on other sites
On 11/10/2017 at 1:53 AM, recursiveElk said:

As an aside: how is the horizontal swipe to transition form achieved? it's really nice!

Yes, it's very, very nice. Kudos!

Share this post


Link to post
Share on other sites
6 hours ago, IElite said:

I believe he asked "How did you achieve it?"

 

I'd like to ask the same question too :D

I don't know if he made it himself or if it's using TW3ScrollController. If there's enough interest, I could write a FormScroller and include it in the RTL.

Share this post


Link to post
Share on other sites

The idea is basically Hardware-Accelerated Page Transitions

...about handling swipe gestures under Smart Pascal, please take a look at this Jon article Dealing with swipe gestures - You can create page transition using those concepts!

The demo does not rely on the traditional Smart RTL, it uses a lightweight framework called "MySmartMS", I believe:

Quote

Smart Mobile Studio has its strenghts and limits. It does wonders for the the Controller part. Some areas, SMS is so rudimentary that, in practice, that RTL alone *.CL - does no provide a sufficient framework for development. I would like SmartMS should focus on the IDE and the compiler. When it comes to writing smart components, interesting components, like page swiper, searchBar, scrolling, reactive components, etc. I believe the correct approach should be based not using "pure smart pascal" approach, it seems everybody ends up rewriting another ball, it's seems, likely waste a lot of time solving problems others have already solved. The core components in SMS should be based in optimized javascript libraries with minimal processing and memory overhead, then you have high level methods (based on external interfaces) to call such methods. That's not necessarily a bad thing using a Framework with SmartMS. In my custom Smart Mobile Studio environment, does not rely on the RTL *.CL framework, I can achieve the same functionality using a different approach, such using visual components - all the functionality relying on optimided-tested-tiny javascript files.

 
 
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×