Go Back   OpenLaszlo Developers Forums > Non-programming help and discussions > Development Tools and Practices

Development Tools and Practices Questions about development tools and practices. An appropriate place to talk about text editors, IDEs, and anything else that makes your development life easier.

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-09-2003, 04:38 PM
antun antun is offline
Forum Administrator
 
Join Date: Jun 2002
Location: San Francisco
Posts: 1,678
antun is on a distinguished road
Creating Dropshadow Text

The example below shows how to create a drop shadow class that reads text that is defined in its instance, and constrains two text fields to that - the first is the foreground and the second is the background, which is offset by a pixel in two directions.

Code:
<canvas bgcolor="0xCC95FF">
    
    <class name="dropshadow">
        <attribute name="text" type="text" />
        <!-- The black background -->
        <text name="bgtext" fgcolor="black" 
              text="${this.parent.fgtext.text}" 
              y="${this.parent.fgtext.y+1}"
              x="${this.parent.fgtext.x+1}"
              width="${this.parent.width}"
              fontstyle="bold" />

        <!-- The white foreground -->
        <text name="fgtext" fgcolor="white"
              text="${this.parent.text}"
              fontstyle="bold"
              resize="true" />

    </class>
    <dropshadow>The quick brown fox jumped over the lazy dog.</dropshadow>
</canvas>
Notice the use of the text attribute in the class definition - this can be used to obtain the node contents. Also note how there is no dynamic instantiation of views - both the foreground and the background are constrained. That way, if the text attribute were to change at runtime, the text field(s) would update.

Enjoy!
__________________
http://www.antunkarlovac.com/blog/

Try out Webtop today:
http://www.gowebtop.com/
Reply With Quote
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mixing static text and dynamically loaded text JulianDownes General OpenLaszlo Programming 1 05-31-2008 05:48 PM
Emacs, nXML, and lzx.rng jbm Development Tools and Practices 11 12-12-2006 05:01 PM
Problems with Animating Dynamic Text mjetpax General OpenLaszlo Programming 2 10-17-2006 02:19 PM
render static and dynamic text in the order they were written rsravipati General OpenLaszlo Programming 2 06-17-2005 11:10 AM
creating a new text object jivesociety General OpenLaszlo Programming 4 11-23-2004 08:33 AM


All times are GMT -8. The time now is 12:18 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.