本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.addTarget方法的典型用法代码示例。如果您正苦于以下问题:Java DragAndDrop.addTarget方法的具体用法?Java DragAndDrop.addTarget怎么用?Java DragAndDrop.addTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop
的用法示例。
在下文中一共展示了DragAndDrop.addTarget方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TasktableActor
import com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop; //导入方法依赖的package包/类
public TasktableActor(DragAndDrop dragAndDrop, Skin skin) {
super("Aktivitäten", skin);
Table table = new Table();
setTable(skin, table, "scrollPaneWindowTasksCalendar");
for (Slot slot : tasktable.getSlots()) {
SlotActor slotActor = new SlotActor(skin, slot);
dragAndDrop.addSource(new SlotSource(slotActor));
dragAndDrop.addTarget(new SlotTarget(slotActor));
dragAndDrop.setDragActorPosition(-CalendarScreen.WIDTHTASK / 2, CalendarScreen.HEIGHTTASK / 2);
table.add(slotActor).width(CalendarScreen.WIDTHTASK).height(CalendarScreen.HEIGHTTASK);
table.row().padTop(5);
}
getScrollTable().setFlickScroll(false);
getScrollTable().setFadeScrollBars(false);
setBounds(AppMain.WIDTH - 212, 70, 210, AppMain.HEIGHT - 72);
setMovable(false);
pad(8);
}
示例2: InventoryActor
import com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop; //导入方法依赖的package包/类
public InventoryActor(Inventory inventory, DragAndDrop dragAndDrop, Skin skin) {
super("Inventory...", skin);
TextButton closeButton = new TextButton("X", skin);
closeButton.addListener(new HidingClickListener(this));
getButtonTable().add(closeButton).height(getPadTop());
setPosition(400, 100);
defaults().space(8);
row().fill().expandX();
int i = 0;
for (Slot slot : inventory.getSlots()) {
SlotActor slotActor = new SlotActor(skin, slot);
dragAndDrop.addSource(new SlotSource(slotActor));
dragAndDrop.addTarget(new SlotTarget(slotActor));
add(slotActor);
i++;
if (i % 5 == 0) {
row();
}
}
pack();
// it is hidden by default
setVisible(false);
}
示例3: addThisAsTarget
import com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop; //导入方法依赖的package包/类
public void addThisAsTarget(DragAndDrop anotherDragAndDrop){
for(SlotActor s:getActorArray()){
anotherDragAndDrop.addTarget(new SlotTarget(s));
}
}
示例4: TimetableActor
import com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop; //导入方法依赖的package包/类
public TimetableActor(DragAndDrop dragAndDrop, Skin skin) {
super("Kalender", skin);
slotActors = new Array<SlotActor>();
setPosition(2, 70);
setMovable(false);
defaults().space(8);
row().fill().expandX();
Array<String> dayTime = new Array<String>(4);
dayTime.add("Mittwoch");
dayTime.add("Donnerstag");
dayTime.add("Freitag");
dayTime.add("Samstag");
dayTime.add("Sonntag");
int dayTimeIndex = 0;
add(new Label("", skin));
add(new Label("Morgens", skin));
add(new Label(" Mittags", skin));
add(new Label("Nachmittags", skin));
add(new Label(" Abends", skin));
row();
add(new Label(dayTime.get(dayTimeIndex), skin));
++dayTimeIndex;
int index = 0;
for (Slot slot : timetable.getSlots()) {
SlotActor slotActor = new SlotActor(skin, slot);
slotActors.add(slotActor);
dragAndDrop.addSource(new SlotSource(slotActor));
dragAndDrop.addTarget(new SlotTarget(slotActor));
dragAndDrop.setDragActorPosition(-CalendarScreen.WIDTHTASK / 2, CalendarScreen.HEIGHTTASK / 2);
if(index % Timetable.COLUMN == 0) {
add(slotActor).width(CalendarScreen.WIDTHTASK).height(CalendarScreen.HEIGHTTASK).padRight(30);
}
else add(slotActor).width(CalendarScreen.WIDTHTASK).height(CalendarScreen.HEIGHTTASK).padRight(8);
++index;
if(index % Timetable.COLUMN == 0) {
row();
if(dayTimeIndex < dayTime.size) {
add(new Label(dayTime.get(dayTimeIndex), skin));
++dayTimeIndex;
}
}
}
pack();
}