Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

Time for some python scripting...

Posted by , 27 August 2014 · 767 views

Tonight my daughter went to bed early, and my wife want to do her stuff, so I have time for working on my project.

Now I rework how I generate my bitmap font. Generating the font sprite sheet is quite straightforward, but I was stuck at generating the sprite list description file : it's not easy to write a bash script that generate a bunch of lines computed using the same formula except for two lines shuffled in the middle.

So I was idly browsing the net, distracting myself, until it crossed my mind that I am not obligated to use bash for any scripting : in my case, python is more suited, as i can loop through a range of number and do a special processing if the value is in a list of special values. As it remains some basic scripting, I just add to find how to get arguments from the command line, and verify the syntax to use on the go. It is still very crude, but I am not writing an application here, so as for me it's ok like that.

I have now a working script, and more importantly, I used the right tool for the task (well, at least a tool that fits better than bash).

It's time to get some sleep now (=.=)

January 2017 »

15161718 19 2021

Recent Comments