Bild stretchen oder vergrößern?

Previous topic - Next topic

LukasOK

Hallo,  =D

Ich möchte noch eine kleine Frage stellen,
Ich versuche (Mobil(z.B.: Handys)) ein Spiel zu strecken oder vielleicht sogar zu verkleinern so halt dem Bildschirm des Gerätes entsprechend. (Das überall das gleiche Bild in der gleichen Größe angezeigt wird.)

Ich hoffe Ihr wisst was ich meine ich versuch es mal in einer Beispiel Skizze zu beschreiben.
(*Das sollten Handys sein(im Bild))

Ian Price

In GLB V14 you can use the command PRESCALER to scale your screen to the desktop size of the device with limited CPU overheads, although I haven't tried this yet myself.
I came. I saw. I played.

spacefractal

PRESCALER might not work on all platform yet. Alternative you can use CREATESCREEN and USESCREEN as well POLYVECTOR to do the same.

The biggest problem is not scaling, but more screen ratio.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

LukasOK

Und wie genau wende ich das an?
Wo soll ich das den setzten?

Ian Price

Look at the PRESCALER example - you use the command once at the start-ish of your progam.


For the POLYVECTOR solution you need to use a virtual screen (use CREATESCREEN to initially set a screen up and USESCREEN to draw your game to every frame) then use the POLYVECTOR to scale and display it to your required dimensions every frame. This solution can be very slow (still real-time), but it depends on how it's used.
I came. I saw. I played.

LukasOK

And Showscreen?
Can you perhaps a project/CODE send
how do you mean?

Kitty Hello

Prescaler 320,200

While true
Print "scaled",0,0
Showscreen
Wend


Man lernt am Besten in dem man es einfach mal PROBIERT.

Schranz0r

Quote from: Kitty Hello on 2015-Dec-23
Prescaler 320,200

While true
Print "scaled",0,0
Showscreen
Wend


Man lernt am Besten in dem man es einfach mal PROBIERT.

True Story!
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

LukasOK

ok es funktioniert soweit aber mit anderen Bildschirmauflösungen nicht, die Größe ist die gleiche aber zum Bespiel Texte verschieben sich aber nach Fenster des Bildschirms zum Beispiel: Ein Text unten ist, verschiebt er sich das nur noch ein halber Text zusehen ist.
Wie soll man das machen?

Kitty Hello

Poste mal Code zum Problem. Ich verstehe es nicht.

LukasOK

Da gibt es leider nicht viel zu posten  ;)
Es hat ja eigentlich super sofort funktioniert.
Der scheiden Teil ist ja eigentlich der:

Prescaler 800,480

While True
Showscreen
Wend


Ich versuch es mal mit Paint(Bilder) zu erklären :D
Also das er es unten Abscheidet ist mit dem bild vielleicht besser als mit einem Text.

Ian Price

PRESCALER doesn't work correctly with screens smaller than the original (<1.0) - so you would need to work out which is the best original resolution to scale up to the most devices.
I came. I saw. I played.

Marmor

ich finde scalierte bilder nicht toll und würde versuchen die meisten auflösungen mit bildern passend zur screengrösse abzudecken.


Bin ich der einzige der plötzlich an sex denken musste ?

Ian Price

Scaling is never going to fit all circumstances. Sometimes it's better to use different sized assets based on device resolution. There is no "one size fits all"

As for the second statement - umm... dirty minds? ;) :P
I came. I saw. I played.

LukasOK

how do you mean?
Do you have an example?