The problem being, my PC screen is 1360 x 778 while my phone is 1440 x 2960
So obviously I can't use a window that is so much taller on my computer screen because most of it is off screen
Even at my max screen res on my PC its too tall (Plus with the res that high I can't really see anything because it makes everything so small)
What can I do to avoid having to port my scripts over to my phone every time I need to test something?
How can I test things on my PC that I plan to port to my phone?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 14
- Joined: Wed Jan 04, 2017 5:53 pm
- yetneverdone
- Party member
- Posts: 448
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: How can I test things on my PC that I plan to port to my phone?
You can use android emulator
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
-
- Prole
- Posts: 26
- Joined: Sun Jan 15, 2017 6:46 am
Re: How can I test things on my PC that I plan to port to my phone?
First, I would not recommend making your game native 1440x2960 especially if you plan on supporting other phones.128Gigabytes wrote: ↑Wed Jun 07, 2017 8:06 am my PC screen is 1360 x 778 while my phone is 1440 x 2960
Reason being it takes Alot more power to scale down large assets then scale up small assets an older phone could possible freeze up and lag depending on the size and volume of scaling.
your phone can support other resolutions
If you dont want to use a resolution library like push, one thing you could do is force your game landscape which would make your phone 2960x1440.
Then you can make a if statement that sees what os your running. if its windows then set screen width = 2960 / 2 and screen height = 1440 / 2 then scaled down all your assets with a scale of .5
-
- Prole
- Posts: 14
- Joined: Wed Jan 04, 2017 5:53 pm
Re: How can I test things on my PC that I plan to port to my phone?
What is a good resolution to make the default then?
-
- Prole
- Posts: 26
- Joined: Sun Jan 15, 2017 6:46 am
Re: How can I test things on my PC that I plan to port to my phone?
I personally use 480x320
-
- Prole
- Posts: 14
- Joined: Wed Jan 04, 2017 5:53 pm
Re: How can I test things on my PC that I plan to port to my phone?
Jeeze, thats gonna give me very little space to work with. Also how do I get the screen resolution so I can upscale correctly?
Like if I wanted to draw a box that was half the screen size, I would make its size (screenResX / 2) by (screenResY / 2)
But I can't figure out how to get the screenRes values.
-
- Prole
- Posts: 26
- Joined: Sun Jan 15, 2017 6:46 am
Re: How can I test things on my PC that I plan to port to my phone?
lets say I'm developing my game for 480x320
Lets sets those to vars
So we want to scale it to our new resolution which is the actual size of the devices we are running the app on.
Lets set those aswell.
Now we want to divide to get our scale factors
We have to divide by the scale so it stays at the same spot of x = 100 y = 100
Also if you use and mouse click functions youd have to divide by the scale aswell.
Note this is a very rough way to scale because it stretches the images with no care to how it looks afterwards.
Thats why you should really look into a resolution handling library such as push because it letterboxes and gets it pixel perfect for you.
Lets sets those to vars
Code: Select all
OriginalWidth, OriginalHeight = 480, 320
Lets set those aswell.
Code: Select all
WindowWidth, WindowHeight = love.graphics.getDimensions()
Code: Select all
ScaleX = WindowWidth / OriginalWidth
ScaleY = WindowHeight / OriginalHeight
-- now we can scale
function love.draw()
love.graphics.push()
love.graphics.scale(ScaleX, ScaleY)
--draw here
--example rectangle
love.graphics.rectangle("fill", 100 / ScaleX, 100 / ScaleY, 100, 100)
love.graphics.pop()
end
Also if you use and mouse click functions youd have to divide by the scale aswell.
Note this is a very rough way to scale because it stretches the images with no care to how it looks afterwards.
Thats why you should really look into a resolution handling library such as push because it letterboxes and gets it pixel perfect for you.
Re: How can I test things on my PC that I plan to port to my phone?
I would recommend developing for 1280x720 - even low-end Android phones have that resolution. From that, it's a nice scale up to 1080p and 2K.
(This applies to both phones and PC)
(This applies to both phones and PC)
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Who is online
Users browsing this forum: Google [Bot] and 4 guests