Ho to get center of the system screen

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Ho to get center of the system screen

FrankBz
Hi, how can I get a point representing the screen center?
I need it to open a morph at that position. So far I tried with - World center - but the position is on the bottom right of the screen.
Does anyone know how to get it?
Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Ho to get center of the system screen

Bert Freudenberg
On 14.03.2010, at 13:02, FrankBz wrote:
>
>
> Hi, how can I get a point representing the screen center?

Display center

> I need it to open a morph at that position.

Hehe:

        morph openCenteredInWorld

Alternatively:
       
        morph center: World center

> So far I tried with - World center - but the position is on the bottom right of the screen.

works for me ... not sure what you mean.

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Ho to get center of the system screen

Jerome Peace
In reply to this post by FrankBz


--- On Sun, 3/14/10, FrankBz <[hidden email]> wrote:

> From: FrankBz <[hidden email]>
> Subject: [Newbies] Ho to get center of the system screen
> To: [hidden email]
> Date: Sunday, March 14, 2010, 8:02 AM
>
> Hi, how can I get a point representing the screen center?
> I need it to open a morph at that position. So far I tried
> with - World
> center - but the position is on the bottom right of the
> screen.
> Does anyone know how to get it?
> Thanks in advance
> --


"Display center" is the center of the screen.

World and Display often have the same bountries.

myMorph postition: Display center .
Will put the morph top right at the center. Therefore the center of the morph will be more towards the bottom right.

myMorph center: Display center .
Will align the two centers which is usually what's wanted.

myMorph openCenteredInWorld .
Will usually put a newly created morph in the center. It can do other things depending on how myMorph deals with layout when sent the selector #openCenteredInWorld.

hth,

Yours in curiosity and service, --Jerome Peace




     
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Ho to get center of the system screen

FrankBz
thanks guys! it works perfectly.. what I meant in my original post was that I tried with - myMorph position: World center - that as pointed out by jerome doesn't correspond to the display center.

regards
Reply | Threaded
Open this post in threaded view
|

Re: Ho to get center of the system screen

Bert Freudenberg
On 15.03.2010, at 09:42, FrankBz wrote:
>
>
> thanks guys! it works perfectly.. what I meant in my original post was that I
> tried with - myMorph position: World center - that as pointed out by jerome
> doesn't correspond to the display center.

It does. But your Morph's position is its upper-left corner so *that* gets aligned with the World's center.

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners