Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$RESIZE questions
#2
(06-06-2024, 09:09 PM)TerryRitchie Wrote: Without $RESIZE:ON in the code I've noticed that _RESIZEWIDTH and _RESIZEHEIGHT report the same as _WIDTH and _HEIGHT.

It's not something I'm seeing when I run the little code here below:

Code: (Select All)
DO
    x = _RESIZEWIDTH
    y = _RESIZEHEIGHT
    PRINT _WIDTH, _HEIGHT, x, y
    _LIMIT 10
LOOP UNTIL x _ANDALSO y

This prints us a couple of zeros on the screen, followed by the values 640, 400, for the x/y values above.

What you're seeing is basically the default settings for everything.  This doesn't have any screen statement, so it's going to be a default SCREEN 0 screen.  The _WIDTH and _HEIGHT are determined basically when the screen starts to initialize itself and get created.  That _RESIZEWIDTH and _RESIZEHEIGHT basically gets set to the default SCREEN width and height, once the window/screen is finally created and registered.

For a few cycles there, the screen isn't fully created/registered, so those values aren't updated. 

Now, as far as I know, with RESIZE OFF (or not in your code), those values will only update when the SCREEN itself changes (and they always seem to lag a bit behind before they update), as illustrated below:

Code: (Select All)
DO
    x = _RESIZEWIDTH
    y = _RESIZEHEIGHT
    PRINT _WIDTH, _HEIGHT, x, y
    _LIMIT 10
LOOP UNTIL x _ANDALSO y

SCREEN _NEWIMAGE(720, 400, 32)
DO
    x = _RESIZEWIDTH
    y = _RESIZEHEIGHT
    PRINT _WIDTH, _HEIGHT, x, y
    _LIMIT 10
LOOP UNTIL x <> 640

Once again, we report the old size of 640, 400 twice on my machine, before we finally swap over to 720, 400 as the finilized size.

That screen has to be finished with it's whole process, before those values update to the default values.



Now, the question becomes, "What should those default values be?"

0 and 0?
Just toss an ERROR?
Some negative values?  -32000, -32000?

Basically, Galleon decided back in the day that the best way to handle these was just to have them default to the current screen's starting size.

So basically, with no $RESIZE ON anywhere in your code, the value is always going to be the pixel value of your screen's width and height.  (Maybe after a few cycles to update settings after a screen change or WIDTH change.)

If that's useful information for you, then make use of it.  Personally though, I think I'd rather just stick to _WIDTH and _HEIGHT in most cases, as it's just less typing.  Smile
Reply


Messages In This Thread
$RESIZE questions - by TerryRitchie - 06-06-2024, 09:09 PM
RE: $RESIZE questions - by SMcNeill - 06-06-2024, 10:22 PM
RE: $RESIZE questions - by TerryRitchie - 06-07-2024, 12:30 AM
RE: $RESIZE questions - by SMcNeill - 06-07-2024, 12:36 AM
RE: $RESIZE questions - by TerryRitchie - 06-07-2024, 12:38 AM
RE: $RESIZE questions - by SMcNeill - 06-07-2024, 12:40 AM
RE: $RESIZE questions - by TerryRitchie - 06-07-2024, 04:37 AM
RE: $RESIZE questions - by SMcNeill - 06-07-2024, 08:05 AM
RE: $RESIZE questions - by TerryRitchie - 06-07-2024, 03:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Hardware images questions Dav 5 477 12-04-2025, 04:18 PM
Last Post: Pete
  A couple of loadimage questions. Pete 7 1,231 04-13-2025, 03:33 PM
Last Post: Kernelpanic
  A couple questions about the dialogs.... Dav 20 4,328 10-14-2023, 04:00 PM
Last Post: TerryRitchie
  API Questions TerryRitchie 24 4,797 08-20-2023, 11:10 PM
Last Post: SpriggsySpriggs
  Various code questions james2464 13 2,914 08-18-2022, 01:31 PM
Last Post: Kernelpanic

Forum Jump:


Users browsing this thread: 1 Guest(s)