Author Topic: Really smart demo!  (Read 8940 times)

0 Members and 1 Guest are viewing this topic.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17407
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Really smart demo!
« on: October 31, 2008 »
Xalthorn made this for my birthday, but it's so good I want to show everyone :)


Thanks!
Try pressing different combinations of the buttons too.. There's a load of effects in this.
« Last Edit: September 11, 2009 by Shockwave »
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Really smart demo!
« Reply #1 on: October 31, 2008 »
What a very cool present from another wonderfull Xalthorn production :D

Loving the Polar Plasmas the best.
Also, got to ask is that in Freebasic and using Windows?

Cheers and have a great special day Shockie.
« Last Edit: November 01, 2008 by Clyde »
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Voltage

  • Professor
  • Pentium
  • *****
  • Posts: 857
  • Karma: 53
    • View Profile
Re: Really smart demo!
« Reply #2 on: November 01, 2008 »
Yeah I grabbed this from your b'day thread.

Very nice work Xalthorn.
Challenge Trophies Won:

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: Really smart demo!
« Reply #3 on: November 01, 2008 »
Also, got to ask is that in Freebasic and using Windows?

Yep, all done in freebasic, just pushing pixels around the place.
Challenge Trophies Won:

gooner

  • Guest
Re: Really smart demo!
« Reply #4 on: November 03, 2008 »
Absolutely fantastic demo Xman. :clap:

The perfect present  ;)

Offline Dr.Death

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 445
  • Karma: 9
    • View Profile
Re: Really smart demo!
« Reply #5 on: November 04, 2008 »
Amazimg demo m8 i never knew freebasic was that good  :clap:
Proud member of DAWN

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Really smart demo!
« Reply #6 on: November 04, 2008 »
Yeah - in deed very good one!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline spitfire

  • Amiga 1200
  • ****
  • Posts: 275
  • Karma: 9
    • View Profile
Re: Really smart demo!
« Reply #7 on: November 04, 2008 »
I hadn't seen this before. I love it, its got such a lighthearted feel to it and the effects are great to stare at.

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: Really smart demo!
« Reply #8 on: November 04, 2008 »
Thanks for the lovely comments folks.

It all started when I saw Shocky's imminent birthday and I fancied doing something silly for him.  It expanded from there ;)
Challenge Trophies Won:

Offline hellsangel

  • C= 64
  • **
  • Posts: 46
  • Karma: 10
    • View Profile
Re: Really smart demo!
« Reply #9 on: November 16, 2008 »
wonderful scrolltext ! love the font and proportional+overlap  :o great effect (how  ??? )

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: Really smart demo!
« Reply #10 on: November 16, 2008 »
wow!
very very lovefully created birthday-demo! *TOP!*
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: Really smart demo!
« Reply #11 on: November 17, 2008 »
wonderful scrolltext ! love the font and proportional+overlap  :o great effect (how  ??? )


I loved doing that scroller, I've been meaning to do one for years, and this was a perfect excuse.  As to how it works.  In essence, it's very simple, but it does have to keep an eye on what it's doing.

The font is a bitmap font where each letter is held in its own rectangle in the rather wide bitmap.

For speed and simplicity, each character is exactly the same width (allows me to calculate the character offset quickly and lazily).  If I were to do this again, I would trim the font down and hold a table of offsets, but I was rushing to get this done in time...

So, each character is 40 pixels wide.  The scroller can be drawn just like any other bitmap scroller except that it would look just awful.

When a character is drawn, there are three things the routine needs to know.

1. A pre-offset in case we need to start drawing the character before the current x-position
2. How wide the character is (although each character takes up a full 40 pixels width, we don't need to draw it all).
3. A post-offset in case we need to move the final x-position around.

So, to draw the capital letter T, we would first of all have a pre-offset to move the drawing cursor left a bit (the top part of the letter T will overhang stuff to the left).  We then draw the whole letter and then move the drawing cursor left quite a bit so that the next character is drawn near the vertical stroke rather than where the horizontal stroke ends.

Another example is a letter with a long tail, like the 'y'.  In this case, the pre-offset is quite large as the tail sweeps very far to the left.  The letter is then drawn and the post-offset hardly moves as the letter finishes quite neatly.

Of course, to stop things being jaggy, the font is also anti-aliased.  In addition, it is also a masked image and that needs to be taken into consideration when drawing the letter onto a textured background to keep things nice and smooth and stop the characters obscuring each other.

This is why the routine crawls a little.  Rather than knowing that a 720 wide display will contain 18 characters, it could contain far more, and sometimes a lot of characters will overlap especially when capital letters or letters with tails are involved.  This constant moving the cursor backwards means that parts of the screen will be used by many different letters at the same time.

One other thing to be aware of is the general scroll offset.  Usually, you shift the initial drawing position left until you've moved a whole character width back and then you increment the string pointer and reset the offset.  With this thing, you need to bear the offsets in mind and keep an eye on that, otherwise the font jumps around like crazy.

Oh, and another gotcha is that you never know in advance how many characters you will be drawing.  With fixed width, it's easy.  With proportional, you need to keep on drawing until you reach a certain x-position which means not only do you need to watch where the main string pointer is in relation to the length of the scrolltext, but you also need to watch the length of the scrolltext in relation to the character you think you'll be drawing next.

If that's as clear as mud, I'll try and explain better.  Hmm, I might even throw it together as a standalone proggy with a proper tutorial if people want...
Challenge Trophies Won:

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: Really smart demo!
« Reply #12 on: November 17, 2008 »
wow!
very very lovefully created birthday-demo! *TOP!*


Aww thanks :D
Challenge Trophies Won:

Offline hellsangel

  • C= 64
  • **
  • Posts: 46
  • Karma: 10
    • View Profile
Re: Really smart demo!
« Reply #13 on: November 17, 2008 »
I was thing about something like that (pre and post values)

have you drawn your own font, or is from an existing one ? (seems to be "Jellyka Estrya's Handwriting" http://www.dafont.com/fr/search.php?psize=m&q=jellyka+estrya+handwriting)


Hmm, I might even throw it together as a standalone proggy with a proper tutorial if people want...


that will be cool  ;D

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: Really smart demo!
« Reply #14 on: November 17, 2008 »
I was thing about something like that (pre and post values)

have you drawn your own font, or is from an existing one ? (seems to be "Jellyka Estrya's Handwriting" http://www.dafont.com/fr/search.php?psize=m&q=jellyka+estrya+handwriting)

If I used my handwriting, you'd never be able to read it ;)

That font name rings a bell, and I definitely grabbed a bunch from dafont to try so it's probably that one.  Some handwriting fonts didn't 'fit' properly, but I liked the one I used.


Hmm, I might even throw it together as a standalone proggy with a proper tutorial if people want...


that will be cool  ;D

Okay, I'll have a go at putting something together with some documentation.  I might get distracted by the imminent challenge though ;)
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17407
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Really smart demo!
« Reply #15 on: November 20, 2008 »
Whoops, sorry. The challenge is launched!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: Really smart demo!
« Reply #16 on: November 20, 2008 »
Whoops, sorry. The challenge is launched!

hehe
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Really smart demo!
« Reply #17 on: November 28, 2008 »
nice one really nice ;D , and with that tune it has a feeling of oldschool demos but with modern graphics :goodpost:


Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17407
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Really smart demo!
« Reply #18 on: November 28, 2008 »
Xalthorn drew them himself I think :)

I was really happy to have this as a birthday card!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Really smart demo!
« Reply #19 on: November 28, 2008 »
Xalthorn drew them himself I think :)

I was really happy to have this as a birthday card!

yup indeed he is mentioning it in the scroller, i've read the whole thingie :P

i would be happy too :updance: