attachImageToActor Solving 3x issues (seems a general solution)

RedEvo

  • Posts: 325
In 3x when attaching an image to an actor, image is attached to x=0.75*w and y=0.75*h.
I've tried to solve repleacing 2420->2443 lines with:
Code: [Select]
                img.imgX = x - (Engine.SCALE * a.getWidth() * (Engine.SCALE / 2));
img.imgY = y - (Engine.SCALE * a.getHeight() * (Engine.SCALE / 2));

It works well with 3x and 1.5x and obliviously with 1x, 2x and 4x.
It can be inserted in distributed code.

Hope this help, David.
Launching RedemptionTCG Android Alpha. If you are interested contact us at info@redevogames.com

captaincomic

  • *
  • Posts: 6108
Thanks! Checked in.

So where do I need to insert this code exactly? Just wondering as I am experiencing problems with the 3x resolution as well and this may solve it.

Thanks, Danny.

captaincomic

  • *
  • Posts: 6108
This has been checked into the main code base, so if you're using the latest version, you don't need to do this manually.

What problems do you have?

At first none of my games would build on the 5.5" iOS simulator.
After I turned on the 3x scale I was able to build the game but the images were extremely low res like if it has been upscaled from 1x instead of using the 4x graphics I imported. I got the same problem on all my games.
Have been solving this issue by reimporting all the art again, but I guess that's not how it's meant to work, but at least it works. :D

Now the game starts and everything is crisp again, but the whole game looks like it has been zoomed out. All images are too small and quite offset.
Any help would be awesome.

Thanks, Danny.

Don't want to push this, but I really need help as I couldn't get my games running fine on an Iphone 6+ :(

Thanks, Danny

Really need help on this.

Any help is appreciated!

captaincomic

  • *
  • Posts: 6108
The 3x scale is generated from existing files if it is missing. It looks for the highest scale available to downscale, but if no higher scale is available it will upscale from 1x.

No idea why your game would look zoomed out. Can you post screenshots? What settings did you use exactly?

Seems like it generates the 3x files from the 1x scale. After importing an image again (after selecting the 3x scale) it  gets the 3x resolution, but it doesn't generate them right automatically.

I'm using "Full Scale" and enabled the 3x in the advanced settings and the mobile>display setting.

-> Seems like using scale to fit (Full Screen) helps to get the proportions right, but now I get weird black lines at the side of some graphics (as in the attached image) and the proportions are not like they used to be before.

Thanks, Danny

And as you can see, that's how the 3x scale looks like, without reimporting all images.

Also with the black lines which I only get on iPhone 6 and 6+.
I guess that's a scaling problem.. Would be great to work in Full Scale mode like I did before.. But I guess that won't work anymore without a lot of extra work. :( Any ideas for a better workflow and some ideas to remove these black lines?

Thanks, Danny

« Last Edit: September 23, 2015, 01:43:25 pm by GameheartStudios »