dot character's

Blitz3D Forums/Blitz3D Beginners Area/dot character's

Steve Elliott(Posted 2004) [#1]
I have a number made out of dots and want to have the dots space out until they fill the screen - but keep their shape - how do you do this?

I've been playing with sin and cos but can't quite get it right, some code would be helpfull.

Many thanks
Steve


TomToad(Posted 2004) [#2]
Do I understand you correctly? You have a number made from dots, like this
    **
   ***
  ** *
     *
     *
     *
 *******
 *******


And you want to expand the dots so the number fills the screen?
take a look at this program, use the arrow keys to change the scale of the dots.

Graphics 800,600
SetBuffer BackBuffer()
Const screenx = 800
Const screeny = 600

Dim numdata(8,8)

.number1
Data 0,0,0,0,1,1,0,0
Data 0,0,0,1,1,1,0,0
Data 0,0,1,1,0,1,0,0
Data 0,0,0,0,0,1,0,0
Data 0,0,0,0,0,1,0,0
Data 0,0,0,0,0,1,0,0
Data 0,1,1,1,1,1,1,1
Data 0,1,1,1,1,1,1,1

Restore number1
For y = 0 To 7
 For x = 0 To 7
  Read numdata(x,y)
 Next
Next
xscale = 1
yscale = 1
xpos = 0
ypos = 0

While Not KeyHit(1)
If KeyHit(200) Then xscale = xscale + 1
If KeyHit(208) And xscale > 1 Then xscale = xscale - 1
If KeyHit(203) And yscale > 1 Then yscale = yscale - 1
If KeyHit(205) Then yscale = yscale + 1

Cls

For x = 0 To 7
 For y = 0 To 7
  If numdata(x,y) = 1
   Oval xpos+x*xscale,ypos+y*yscale,xscale,yscale,True
  End If
 Next
Next

Flip
Wend


if you want the dots to remain the same size, but simply just spread out, you can replace
Oval xpos+x*xscale,ypos+y*yscale,xscale,yscale,True

with
Oval xpos+x*xscale,ypos+y*yscale,1,1,True

or whatever size you want the dots to be.


Steve Elliott(Posted 2004) [#3]
Thanks Tom, I should have used the same data strucure as you have - it would have been easier to solve then (I was using graphics coordinates instead of just 1's and 0's).

Yes I just wanted them to spread out - thanks again.