Friday, February 19, 2010



Three Dimensional Bars! Well, I guess to be more accurate they would be called isometric?
I had been thinking about doing this for a while and it seemed like an obvious idea :)

Anyway, I thought this project would be easy, and to begin with it was. Getting a bar on Lua is pretty easy, then all I would have to do is draw a top and a side and get everything moving correctly. This all happened quickly until I started to look at the lines!

Unfortunately I couldn't simply take the shapes I had drawn to form the "faces" with fill, and overlay them using stroke. The corners stuck out when the line width was increased and the different line unison options in cairo were not going to work. So I had to re-do the lines from scratch, and it took far too may attempts and corrections before I finally got it right.

With this script you can specify:
  • face color
  • line color
  • bar width ("depth" is always set to width/2)
  • bar height
  • bar position
  • wire-frame outline on or off
  • and font, font size, font color and font position
You can get the code on the crunchbanglinux forum here.

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. My goodness I'm posting alot...

    Anyways I fixed the above problems, although when I try to start conky with the script it reads back:
    paul@paul-laptop:~$ ~/.conky/conky_start
    Conky: /home/paul/.scripts/bars: 1: no such configuration: '--[[isometric'
    Conky: /home/paul/.scripts/bars: 2: no such configuration: 'function'
    Conky: /home/paul/.scripts/bars: 3: no such configuration: '--line'
    Conky: /home/paul/.scripts/bars: 4: no such configuration: 'local'
    Conky: /home/paul/.scripts/bars: 5: no such configuration: 'local'
    Conky: /home/paul/.scripts/bars: 8: no such configuration: 'if'
    Conky: /home/paul/.scripts/bars: 9: no such configuration: 'advant-window-navigator_set_source_rgba'
    Conky: /home/paul/.scripts/bars: 10: no such configuration: 'cairo_set_line_width'
    and the same error for every line of the script. What's wrong?

    ReplyDelete