JAVAFX:在图形场景中显示 UI 对象
2009-01-01 21:46
302 查看
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.image.Image;
import javafx.scene.Node;
import javafx.scene.text.Text;
import javafx.scene.transform.Rotate;
import javafx.scene.transform.Transform;
import javafx.scene.image.ImageView;
Stage{
height:600
width:800
visible:true
scene:Scene{
fill:LinearGradient{ //线性填充
startX:0 startY:0 endX:800 endY:0 proportional:false
stops:[Stop{offset:0.0 color:Color.BURLYWOOD},
Stop{offset:1.0 color:Color.WHITE}]
}
content:[Circle { //圆
centerX:400,
centerY:300
radius: 100
fill: Color.AZURE
},Text{ //文本
content:"jijljigjle"
transforms:Transform.rotate(180, 200, 180) //以坐标(200,180)为圆心旋转180度
},ImageView {
x:40 y:50 fitWidth:50 fitHeight:50 //将图片收缩为50*50
image: Image {
url: "{__DIR__}009.png" //{__DIR__}为源文件的目录
}
}
]
}
}
import javafx.scene.Scene;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.image.Image;
import javafx.scene.Node;
import javafx.scene.text.Text;
import javafx.scene.transform.Rotate;
import javafx.scene.transform.Transform;
import javafx.scene.image.ImageView;
Stage{
height:600
width:800
visible:true
scene:Scene{
fill:LinearGradient{ //线性填充
startX:0 startY:0 endX:800 endY:0 proportional:false
stops:[Stop{offset:0.0 color:Color.BURLYWOOD},
Stop{offset:1.0 color:Color.WHITE}]
}
content:[Circle { //圆
centerX:400,
centerY:300
radius: 100
fill: Color.AZURE
},Text{ //文本
content:"jijljigjle"
transforms:Transform.rotate(180, 200, 180) //以坐标(200,180)为圆心旋转180度
},ImageView {
x:40 y:50 fitWidth:50 fitHeight:50 //将图片收缩为50*50
image: Image {
url: "{__DIR__}009.png" //{__DIR__}为源文件的目录
}
}
]
}
}
相关文章推荐
- 第 3 课:在图形场景中显示 UI 对象
- OSG多线程,多显示场景图形设计
- 如何在FineUIMvc(ASP.NET MVC)中显示复杂的表格列数据(列表和对象)?
- 多线程,多显示场景图形设计:一种新的过程模型
- 【Unity&NGUI】为什么把NGUI的UI制作为预制体,再生成到新场景,UI无法正常在Game视图显示
- [BS-01] 根据字符串对象的参数自动计算用来显示该字符串的UI控件的宽和高
- [转]如何处理UI对象和场景对象点击事件冲突/重复
- UE4创建3D场景中的UI方法及在UI上面显示三维物体
- VR/AR场景 中给人物添加血条 双面显示/ UI显示两个的处理
- Maya: 视图 视图的基本操作>使场景中所有对象最大化显示
- stage3D 搭建2d图形引擎 (五)不同纹理的显示对象
- [Unity3D]Unity3D游戏开发3D选择场景中的对象,并显示轮廓效果强化版
- 多线程,多显示场景图形设计:一种新的过程模型
- struts2 dao层使用list对象model型临时数据,web前端显示数据
- 实时显示iOS编写UI代码效果
- wp7模拟器开启不了,显示“被调用的对象已与其客户端断开连接”或者“接口”。并且提示有文件损坏的处理方法
- 菜单UI点击隐藏与显示(滑动)
- PHP将DateTime对象转化为友好时间显示的实现代码
- javascript显示对象所有属性的方法
- 小程序弹出的遮罩只有一屏高度,滚动显示出下面的UI