Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using _MapTriangle in Small Virtual Screens
#4
(07-04-2025, 05:54 AM)NakedApe Wrote: Ahh, okay, thanks for the armchair analysis, Steve! I think I get it now. I'll noodle around and see if I can make it work.
Now go back to resting your body.   Wink

See if this helps explain what you're doing wrong here:

Code: (Select All)
Dim As Long Image, virt
Screen _NewImage(160, 120, 32) '                                                                a wee screen
$Color:32
Color Yellow

_PrintString (_Width \ 2 - _PrintWidth("TESTING!") \ 2, _Height \ 2), "TESTING!" '              print something
Image = _CopyImage(_Display, 33) '                                                              make it a hardware image
_Delay 2: Sound 2000, .1

'Steve changes explained as we go along here:
'First, move virt outside the loop.  No need to make endless copies inside the loop when we're only using the final one
'The loop doesn't change any values, so it's not tilting slowly or anything..
'It's just spending 2.5 a seconds to showcase the same thing repeatedly
'and make 50 hardware copies of the same software image (the display with the _PRINTSTRING text above written on it)

_MapTriangle (0, 0)-(0, 119)-(159, 119), Image To(-8, 8, -12)-(-8, -8, -4)-(8, -8, -4), 0
_MapTriangle (0, 0)-(159, 119)-(159, 0), Image To(-8, 8, -12)-(8, -8, -4)-(8, 8, -12), 0
_Display '                                                                                  render it for a few cycles

_Delay 2.5 'By adding this delay here, we generate the same 2.5 seconds of viewing pleasure


'Note that we only drew on the hardware layer.  Our software layter still holds that same "TESTING"
'which was placed on it by the _PRINTSTRING statement above.
'It's just *hidden* by the hardware overlay which is OVER it at the moment.

virt = _CopyImage(_Display, 33) '                                                          copy it to another hardware image

'And thus, that _COPYIMAGE just made a copy of that non-titled "TESTING!" which is on the display.
'(The display which is hidden with the hardware overlay of the tilted text over it.)


'Then, since we're using the main screen to draw our normal text, we should clear it afterwards.  Note that the tilted text is ONLY on the hardware layer as IMAGE is a hardware image from copyimage, 33
Cls , 0 'This clears it
_Display 'And this updates the display to show it clear
'Without the _DISPLAY, we wouldn't update the screen with the CLS statement above it

Sound 400, .1

_ScreenMove 600, 400 '                                                                          move screen and display the copy


_Delay 2.5 'A pause added here so we can now see that we DO, indeed have a blank screen

_PutImage , virt '              Why doesn't this hardware image need a loop to display? Or a _Display command?


'Note that this delay shows that the _PUTIMAGE doesn't do anything for us...
'At least, not until the next _DISPLAY statement updates the screen and shows the hardware buffer
_Delay 2.5 '                    AND WHY CAN'T I GET THIS VIRT IMAGE TO APPEAR ON ANOTHER, BIGGER SCREEN?!



_Display 'This shows it as it should exist for us now -- the normal text which we last copied from the software screen

_Delay 2.5 'And this gives us time to see it

System

Copy that into the IDE and read over the comments.  It explains the flow of what you're doing, and the changes I made to highlight those issues.

What you want to do is:
1) Just make yourself a _NEWIMAGE the same size as your display screen.
2) Make a copy of that image while it's still blank.  You now have two blank images to work with.
3) Draw the text on that first image normally, so you don't corrupt your display.
3) Use the first image as a reference point to _MAPTRIANGLE the desired tilt onto the second image.
4) NOW make a hardware image of that second, tilted image.
5) Free up both those temporary software screens that you no longer need.

You'll now have your hardware text titled onto an image that you can _PUTIMAGE wherever you want onto your screen.  (Or, over the whole screen as you do with that last _PUTIMAGE ,virt statement.
Reply


Messages In This Thread
RE: Using _MapTriangle in Small Virtual Screens - by SMcNeill - 07-04-2025, 11:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  _MAPTRIANGLE EXAMPLES NakedApe 22 1,352 01-25-2026, 05:43 PM
Last Post: ahenry3068
  A Question About _MAPTRIANGLE Magdha 2 390 11-02-2025, 11:37 AM
Last Post: Magdha
  Locate command on the ttf graphical screens Helium5793 5 724 03-09-2025, 05:47 PM
Last Post: SMcNeill
  open multiple screens at once drewdavis 2 794 09-09-2024, 08:08 AM
Last Post: Pete
  Does _MapTriangle work in a user defined Window? bplus 12 2,283 02-16-2024, 01:40 AM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)