In Flex 4 (Gumbo) gibt es eine neue Grafik-Library mit dem Namen FXG. Darin sind z.B. die folgende geometrische Grundformen vorhanden, die nun über MXML gezeichnet werden können:
- <Rect> (Rechteck)
- <Ellipse> (Ellipse)
- <Path> (Pfade)
- <Line> (Linien)
- <TextGraphic> (Texte als Grafik)
Die Konturen (strokes) und Flächen (fills) sowie Filter, Masken, Alphas und Blendmodes können ebenfalls über MXML gesteuert werden. Die einzelnen Grafikelemente kann man auch über <Group> zu einer Einheit zusammenfassen.
FXG soll des Weiteren als Austauschformat für Flex und Thermo zum Einsatz kommen. Dabei ist FXG ein Subset von MXML und kann sich auch in extra Dateien mit der Dateiendung .fxg befinden.
Das folgende Beispiel zeigt meinen ersten Versuch mit den Grafikkomponenten. Es handelt sich um ein einfaches "Hello World", das alle neuen Komponenten auf der Bühne platziert. Zur Kompilierung wird ein Nightly Build von Flex 4 benötigt. Abspielbar ist das SWF-File mit dem darin enthaltenen Flash Player.

-
<mx:Application xmlns:mx="http://ns.adobe.com/mxml/2009" >
-
-
<!-- Rechteck -->
-
<mx:Rect left="20" top="20" width="100" height="100">
-
-
<!-- Kontur -->
-
<mx:stroke>
-
<mx:SolidColorStroke color="0x005571" />
-
</mx:stroke>
-
-
<!-- Fill -->
-
<mx:fill>
-
<mx:SolidColor color="0xe8f9ff" />
-
</mx:fill>
-
-
</mx:Rect>
-
-
-
<!-- Ellipse -->
-
<mx:Ellipse left="200" top="20" width="100" height="100">
-
-
<!-- Kontur -->
-
<mx:stroke>
-
<mx:SolidColorStroke color="0x5f7101" />
-
</mx:stroke>
-
-
<!-- Fill -->
-
<mx:fill>
-
<mx:SolidColor color="0xc6d381" />
-
</mx:fill>
-
-
</mx:Ellipse>
-
-
-
<!-- Line -->
-
<mx:Line left="400" top="20" width="100" height="100">
-
-
<!-- Kontur -->
-
<mx:stroke>
-
<mx:SolidColorStroke color="0x333333" />
-
</mx:stroke>
-
-
-
</mx:Line>
-
-
-
<!-- TextGraphic -->
-
<mx:TextGraphic left="400" top="200" width="100" height="100" content="TextGraphic">
-
</mx:TextGraphic>
-
-
<!-- Path -->
-
<mx:Path left="200" top="200" data="Q 400 200 100 0">
-
-
<!-- Kontur -->
-
<mx:stroke>
-
<mx:SolidColorStroke color="0x333333" />
-
</mx:stroke>
-
-
-
<!-- Fill -->
-
<mx:fill>
-
<mx:SolidColor color="0xfdf2b2" />
-
</mx:fill>
-
-
</mx:Path>
-
-
-
</mx:Application>
4 Kommentare zum Beitrag "Flex 4: Neue Grafik-Library (Rect, Ellipse, Path, Line, TextGraphic)"
<strong>Flex 4 Dokumentation ist online (Gumbo API Reference)…</strong>
Die Dokumentation zur kommenden Flex 4 Version (Codename Gumbo) liegt nun vor. Die ActionScript-Referenz wird laut des Flex Documentation Teams ungefähr einmal in der Woche aktualisiert.
Das Flex 4 SDK ist aktuell als Nightly Build im Adobe Labs verf….
[...] Flex 4: Neue Grafik-Library (German) [...]
[...] take the look-and-feel of Flex applications to the next level. For less patient ones here is very trivial example of FXG usage. Even if you don’t understand German language, it is not likely you will not [...]
Eine Serie mit Artikel zu Flex 4 (Gumbo) gibt es hier:
http://www.video-flash.de/index/flex-4-gumbo-wochen-auf-video-flash/
Schreibe einen Kommentar