Author Topic: Another size matters thread. This time, screen size...  (Read 2956 times)

0 Members and 1 Guest are viewing this topic.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Another size matters thread. This time, screen size...
« on: November 29, 2018, 01:53:57 pm »
As I was replying in another post, I got this idea to ask others about how they handle, or wish they could handle screen size changes from one computer to another.

I have several laptops, 19 inch, 17 inch, 15 inch, and even one 12 inch. My 19 inch became my standby. As i get older, I don't blow money on glasses, I just buy bigger screens! Anyway, I find it difficult to transfer and run things like _SCREENCLICK routines, which are based on the laptop screen size, instead of just the program window. I would also think for _MEM or other graphics programs, this would be a problem. If you made a window just about the full size of a 19" screen, that won't do well if you run it on a 12" screen.

I don't do graphics, but I'm presuming _NEWIMAGE is setting the size in pixels, so smaller screen, fewer pixels, right? Also some screens are wide screen displays, etc. I've thought about making an algorithm to automatically detect the screen size, if possible, and then converting values so variables in a _SCREENCLICK routine could be adjusted to run on any size screen.

I'll give you guys an example of a very useful _SCREENCLICK routine I made for community emails. You can make programs that do all the work of putting together a mass email, except you can't program a way to send them. Well, you can, if you position the email and use _SCREENCLICK. Sure, BBC could be used, but most ISP companies flag over 15 BBC entries but if you use 15 and send 100 of them, they are OK with that. Yeah _SCREENCLICK!

Anyway, this is just a thread to share ideas, experiences, and solutions when switching your programs to different computers with different screen sizes.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Another size matters thread. This time, screen size...
« Reply #1 on: November 29, 2018, 07:17:59 pm »
_SCREENCLICK is based on the PIXEL location not the inch location, so if your 12" screen is 1280x768(not likely but just for this case) and your 19" screen was 1280x768 then a _SCREENCLICK 720,500  should click the same location on each screen. but I imagine your 12" screen is probably 640x480 unless your wearing tri-focals! if due to some kind of scaling issue, which you could probably mathematically work out, you may need to come up with a work around, like finding some common feature that exists on all screens and 'test' back with say POINT and find where the new _SCREENCLICK location would be.

As for me I use it for automating certain repetitive aspects of games. or cheating if you prefer.
Granted after becoming radioactive I only have a half-life!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Another size matters thread. This time, screen size...
« Reply #2 on: November 29, 2018, 07:36:32 pm »
True on the pixel issue but I do find the wide screen monitors and regular screen sizes have cause me to pull out a few hairs at times. At my age, I'm completely bald, so you can imagine the extra distress that causes me. Shut up Bill!

I still think _NEWIMAGE screen sizes would be a problem, right?

I downloaded your Battleship game. I used to play my friend and beat him all the time... until he finally realized sitting with his back to a wall mounted mirror wasn't the best place to command his fleet. :D

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Another size matters thread. This time, screen size...
« Reply #3 on: November 29, 2018, 11:05:17 pm »
The trick is to do 1 of 2 things:

1) Code in a set size such as 640x480, and then use $RESIZE: STRETCH.  Then as a user, you can stretch the screen so it'll fit on your monitor, no matter the size or resolution.  This is an easy, one line solution, which works for most people.

Or...

2) Use a WorkScreen of set size, such as 640x480, and draw on it.  Then scale it with _PUTIMAGE to the DisplayScreen, which you can set to any size you desire.  For mouse input, read it from the DisplayScreen then scale it to the size of the WorkScreen.  All internal values for button positions, clicks, and such are used in relation to the 640x480 size.

The first solution is the easiest to use, but it requires the user to stretch the screen to a workable resolution everytime the program starts.  The second takes just a little bit more work to implement, but allows you to scale your screen to a suitable resolution from the start.

If you need examples of either method, just say something, and I can work you up a demo in no time.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Another size matters thread. This time, screen size...
« Reply #4 on: November 29, 2018, 11:25:45 pm »
I know your family has a lot to process, so maybe now isn't the time, unless involvement in other things is a help. I do think some sort of demo would be great as a permanent addition to the wiki, as well.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/