0
您好我想旋转文本(-40)/我有问题,当一个文本短这个开始对不同势hegh我想要的文本,当我开始标记。这PUNKT我喜欢这个了JavaFx旋转文本
for(int i=0; i<=Config.busSizeInView; i++){
gc.drawImage(busStop, 10+i*Config.xSize/Config.busSizeInView, Config.ySize -100, 20, 20);
}
for(int i =0 ;i<Config.busSizeInView;i++){
nameBusStop.add(new Text("Konstytucji 3 Maja - Dworzec PKS 02"));
}
for(int i=0 ; i<nameBusStop.size(); i++){
nameBusStop.get(i).setRotate(-40);
nameBusStop.get(i).setText(Main3.listBusStops.get(i).getName());
}
for(int i =0 ; i<nameBusStop.size(); i++){
nameBusStop.get(i).relocate(i*Config.xSize/Config.busSizeInView-Config.padding-10, Config.ySize - Config.ySize/6 - Config.padding*3);
}
line.getChildren().addAll(canvas,txtPane);
Pane txtPane = new Pane();
for(Text text : nameBusStop){
text.setFont(Font.font ("Verdana", 20));
txtPane.getChildren().add(text);
}
line.getChildren().addAll(canvas,txtPane);
您使用画布绘制图片,但使用一些其他的窗格来添加名字???什么是您使用的布局(高达'Canvas'的共同祖先和你的文本元素的父) – fabian
@fabian文本我有窗格和帆布我有不同势窗格,窗格都我添加到堆栈窗格 –
什么你使用'StackPane'对齐吗? – fabian