2 questions: centering and relative paths

Klaus Major k_major at os.surf2000.de
Thu Oct 31 09:17:00 EST 2002


Buona sera Giulio,

> ...
> 1) Can't find a way to imitate the Director "Full screen" option.
> I tryed this way:
>
> on preopenstack
>    set the rect of this stack to the screenrect
> end preopenstack
>
> using the geometry  manager i have set all the objects on the form 
> with a location relative to the image i use as background
>
> using the geometry  manager i have set the image i use as background 
> with a location relative to the card, exactly 0 pixel from the center 
> of the card, both horizontal and vertical.
>
> Nothing to do: the backgroud and all the controls stay always on the 
> topleft corner of the screen.

This is an easy one.

Create your stack in your desired size and put this into the stack 
script:

on preopenstack
   set the loc of this stack to the screenloc
   ### will center your stack, step 1
   set the backdrop to x,y,z
   ### where x,y,z has to be replaced
   ### by any RGB value, like the "stage-color" in Director
   ### where the background is replaced by that color
   ###step 2
end preopenstack

Check the dictionary for "backdrop".

> 2) I would like to keep all the images I use(Backgrounds, photos, 
> etc.)  on an external folder, let's say "media", on the same level of 
> the application.
> I can't find a way to set the filename on the properties of an Image 
> as a relative path (i mean on the IDE, not from transcript), using the 
> browse button i have always an absolute path that is mantaind on the 
> compiled app, so moving the app with its folder on another location  
> will not work, and obviously will not work moving to a windows 
> environment.

Timothy already answered this one...

> thanks in advance,
>
>        Giulio

Arrivederci


Klaus Major
k_major at os.surf2000.de




More information about the use-livecode mailing list