Pages: [1]
  Print  
Author Topic: centering site anti-aliases my pixels  (Read 197 times)
lukesturgeon
Gaia User
**
Posts: 17


« on: July 15, 2008, 12:54:35 AM »

Hey I don't know if anyone else is having this issue. Usually if I create a design and center it with a 100% page the design stays sharp because when I resize my browser it's pixel perfect.

However I'm rebuilding my site using the Gaia framework and notices that when I resize my browser the content on the site anti-aliases and shifts between pixels?

I tried to find a method yesterday that was controlling the x, y coords for the pages on resize but couldn't see anything. I hoped that maybe Math.round() could solve the problem.

Here is my current site (no Gaia) - http://www.lukesturgeon.co.uk
Here is my new site (Gaia) - http://clients.lukesturgeon.co.uk/dev/

Has anyone else overcome this problem?
Logged
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 1643



WWW
« Reply #1 on: July 15, 2008, 05:32:35 AM »

Math.round should fix the issue.  Does it not?
Logged

Steven Sacks | Gaia Author
If you like Gaia, please donate to the project!  Smiley
lukesturgeon
Gaia User
**
Posts: 17


« Reply #2 on: July 15, 2008, 05:06:38 PM »

hey steven,

I want to use Math.round() but I'm not sure where to place this at the moment. I wasn't sure if there was a method somewhere within the Gaia framework which modifies, adjusts or controls the x and y of the movieclips on the stage? I couldn't find anything.

Is there any method in any class that you can think of that could be affecting the x and y? perhaps something that add the children to the stage and controls the onResize event?

I will try and look through this and experiment a bit more with this. Obviously I don't want to end up adding Math.round() calls to the x and y property of each movieclip on the stage on resize. I'm sure there's a neater way of fixing this.
Logged
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 1643



WWW
« Reply #3 on: July 15, 2008, 07:04:41 PM »

Main.as, onResize, round the x and y equations.
Logged

Steven Sacks | Gaia Author
If you like Gaia, please donate to the project!  Smiley
lukesturgeon
Gaia User
**
Posts: 17


« Reply #4 on: July 15, 2008, 11:04:55 PM »

SOLVED, fantastic steven thankyou.

I was searching through the core, api and flow classes in gaiaframework etc but forgot about the Main.as file. Perhaps this is something that could be default in further versions of Gaia? Just because I wouldn't know anyone that wouldn't want there site on the pixels.

Thanks with this.
Logged
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 1643



WWW
« Reply #5 on: July 15, 2008, 11:38:36 PM »

Enough people have asked for it, I might as well considering the negative effect it has on bitmaps and fonts.
Logged

Steven Sacks | Gaia Author
If you like Gaia, please donate to the project!  Smiley
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 1643



WWW
« Reply #6 on: August 06, 2008, 01:38:20 AM »

I forgot to add this to the latest release.  It will be in the next one.
Logged

Steven Sacks | Gaia Author
If you like Gaia, please donate to the project!  Smiley
liflaf
Gaia User
**
Posts: 17


« Reply #7 on: October 06, 2008, 04:39:16 AM »

Hi Steven,

I was just wondering. The 2.3.9. overview says "Main.as now uses Math.round()". So shouldn't Main.as look something like this? (in 2.4.9. as2.0):

Code:
private function onResize():Void
    {
        clip._x = Math.round((Stage.width - _$WIDTH) / 2);
        clip._y = Math.round((Stage.height - _$HEIGHT) / 2);
    }

Pieter
Logged
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 1643



WWW
« Reply #8 on: October 06, 2008, 08:52:51 AM »

Download 2.4.9 again.
Logged

Steven Sacks | Gaia Author
If you like Gaia, please donate to the project!  Smiley
Pages: [1]
  Print  
 
Jump to:  

TinyPortal v1.0.5 beta 1© Bloc