BASIC

Author Topic: screen aspect changing  (Read 136 times)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
screen aspect changing
« on: 2017-Oct-24 »
Hi

Say I have a windows portrait game and I want to put the portrait game within the window of a landscape backdrop.

Is that easy or possible with createscreen or viewports?

Has anyone done this?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline dreamerman

  • Mr. Polyvector
  • ***
  • Posts: 159
    • View Profile
    • my personal website
Re: screen aspect changing
« Reply #1 on: 2017-Oct-24 »
Never used viewports, but createscreen and usescreen are sufficient for this. Calculate scaling and borders, draw all game stuff on offscreen texture/sprite, then draw that sprite centered normally on screen with scaling, to get proper mouse coords just something like finalX = (currX - borderX) / scale.. On desktop there shouldn't be any problems with SCREEN commands.
Check my source code editor for GLBasic - link

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: screen aspect changing
« Reply #2 on: 2017-Oct-24 »
Vertical games often dont look good on a pc landscape screen. yes you can use the VIEWPORT command to limit the drawings. But would around property same when people take vertical based videos.

So if you can, recode so they works in landscape. That why all my games is landscape mode only or priority landscape higher than portrait mode. Portrait is good on mobile or arcade, but not that good on pc....Even it's should been easy with VIEWPORT.
« Last Edit: 2017-Oct-25 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.