JFXtras Core 入門 - Shape (3)
シェイプの3回目です。
今回は
- Cross
- Donut
- ETriangle
- ITriangle
- Lauburu
を描いてみようと思います。
org.jfxtras.scene.shape.Cross
import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.paint.Color; import org.jfxtras.scene.shape.Cross; Stage { title: "JFXtras Shape Cross" width: 150 height: 150 scene: Scene { content: [ Cross { centerX: 50 centerY: 50 radius: 40 width: 20 roundness: 0.5 fill: Color.AQUA } ] } }
Cross のプロパティで特に難しいものは無いと思います。前回の Asterisk に似ています。
org.jfxtras.scene.shape.Donut
import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.paint.Color; import org.jfxtras.scene.shape.Donut; Stage { title: "JFXtras Shape Donut" width: 150 height: 150 scene: Scene { content: [ Donut { centerX: 60 centerY: 60 outerRadius: 50 innerRadius: 20 sides: 0 fill: Color.CHOCOLATE } ] } }
プロパティ | 説明 |
---|---|
innerRadius | 内側の円の半径 |
outerRadius | 外側の円の半径 |
sides | 辺の数 |
org.jfxtras.scene.shape.ETriangle
package jfxtrasexamples.shape; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.paint.Color; import org.jfxtras.scene.shape.ETriangle; Stage { title: "JFXtras Shape ETriangle" width: 150 height: 150 scene: Scene { content: [ ETriangle { x: 30 y: 80 width: 70 fill: Color.BLUE } ] } }
プロパティ | 説明 |
---|---|
width | 一辺の幅 |
x | 三角形の左下の X 座標 |
y | 三角形の左下の Y 座標 |
org.jfxtras.scene.shape.ITriangle
import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.paint.Color; import org.jfxtras.scene.shape.ITriangle; Stage { title: "JFXtras Shape ITriangle" width: 150 height: 150 scene: Scene { content: [ ITriangle { x: 40 y: 100 width: 60 height: 80 fill: Color.SILVER } ] } }
プロパティ | 説明 |
---|---|
width | 底辺の幅 |
height | 三角形の高さ |
org.jfxtras.scene.shape.Lauburu
import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.paint.Color; import org.jfxtras.scene.shape.Lauburu; Stage { title: "JFXtras Shape Lauburu" width: 150 height: 150 scene: Scene { content: [ Lauburu { centerX: 60 centerY: 60 radius: 50 fill: Color.RED } ] } }
難しいプロパティは無いと思います。
今日はここまで。シェイプはあと2回続きます。ちょっと長いでしょうか。(笑って誤魔化す)