Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_Putimage Question.
#11
STEP is the simplest command in the world.   It's just that number of pixels in X/Y change.

(100,100)- STEP (10,10)

This would start at pixel (100,100) and end up 10 pixels right, 10 pixels down.
It's the equivalent of (100,100)-(110,110)

All STEP does is add the value inside the step to the last plotted point used.

Code: (Select All)
Screen _NewImage(800, 600, 32)

PSet (100, 100)
Line -Step(100, 100), , BF

Easiest example in the world.   Start with changing the PSET a few times to experiment.  See where you use it (in this case) to set the graphic pointer somewhere on the screen?

Then the line command here will draw you a box 100 pixels right and 100 pixels down from that point you PSET.   Change those values to change the size of that box.

That's all that STEP is.   Step(yourX, yourY) is just (previousX + yourX, previousY +yourY)
Reply
#12
Nice! You needed another +1 to stay tied with Mark, anyway... Good luck getting it! Big Grin Kidding, +1

So here is Mark's step solution, which I fiddled with a bit after I figured out Step to some degree...

Code: (Select All)
Width 80, 25: _Font 16
fw = _FontWidth: fh = _FontHeight
t = _NewImage(fw * 2, fh, 32)
_Dest t
' Draw a triangle.
a = 6: c = 0: w = a * 2: h = a
For i = 0 To 6
    Line (a, c)-(a + i * 2, c)
    a = a - 1
    c = c + 1
Next
tri& = _CopyImage(t, 33)
_Dest 0
_FreeImage t
col = 32: row = 5: BarLength = 8
Locate row, col + 2: Print "__________Row"; row
Locate row + 8, col + 2: Print "__________Row"; row + 8
Locate row + 1, col
For j = 1 To BarLength
    Locate , col: Print Chr$(219)
Next
sx1 = col * fw - fw - 2: sy1 = fh \ 2 - 2
sx2 = sx1 + c * 2 * fw: sy2 = sy1 + i * fh + 3
TopTriangle = row * fh - fh ' 1st num is row in Screen 0.
xfactor = fh * (i - 1) - TopTriangle
BottomTriangle = BarLength * fh
Do
    _Limit 30
    _PutImage (sx1, sy1 + TopTriangle)-Step(w, h), tri&, 0, (0, 0)-(w, h) '<<<<<<<<<<<<
    _PutImage (sx1, sy2 - xfactor + BottomTriangle)-Step(w, -h), tri&, 0, (0, 0)-(w, h) '<<
Loop

Pete
Shoot first and shoot people who ask questions, later.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Nice simple, I hope, question Mad Axeman 4 335 12-20-2025, 09:28 PM
Last Post: SMcNeill
  _putimage (Solved) Pete 0 217 11-16-2025, 06:48 AM
Last Post: Pete
  NewBie Question niteflyer 2 329 11-06-2025, 07:11 PM
Last Post: Petr
  A Question About _MAPTRIANGLE Magdha 2 373 11-02-2025, 11:37 AM
Last Post: Magdha
  '$include: 'file.tmr' Timing Question pmackay 2 428 10-16-2025, 12:20 PM
Last Post: a740g

Forum Jump:


Users browsing this thread: