com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.getWidth()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.getWidth()方法的一些代码示例,展示了WidgetGroup.getWidth()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WidgetGroup.getWidth()方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
类名称:WidgetGroup
方法名:getWidth

WidgetGroup.getWidth介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

  1. parentHeight = parent.getHeight();
  2. if (getWidth() != parentWidth || getHeight() != parentHeight) {
  3. setWidth(parentWidth);
  4. setHeight(parentHeight);

代码示例来源:origin: libgdx/libgdx

  1. parentHeight = parent.getHeight();
  2. if (getWidth() != parentWidth || getHeight() != parentHeight) {
  3. setWidth(parentWidth);
  4. setHeight(parentHeight);

代码示例来源:origin: com.badlogicgames.gdx/gdx

  1. parentHeight = parent.getHeight();
  2. if (getWidth() != parentWidth || getHeight() != parentHeight) {
  3. setWidth(parentWidth);
  4. setHeight(parentHeight);

代码示例来源:origin: kotcrab/vis-ui

  1. @Override
  2. public boolean onEnd (Draggable draggable, Actor actor, float stageX, float stageY) {
  3. boolean result = super.onEnd(draggable, actor, stageX, stageY);
  4. if (result == APPROVE) return APPROVE;
  5. if (dragged == false) return CANCEL;
  6. // check if any actor corner is over some other tab
  7. tabsPane.stageToLocalCoordinates(tmpVector.set(stageX, stageY));
  8. if (tabsPane.hit(tmpVector.x, tmpVector.y, true) != null) return CANCEL;
  9. if (tabsPane.hit(tmpVector.x + actor.getWidth(), tmpVector.y, true) != null) return CANCEL;
  10. if (tabsPane.hit(tmpVector.x, tmpVector.y - actor.getHeight(), true) != null) return CANCEL;
  11. if (tabsPane.hit(tmpVector.x + actor.getWidth(), tmpVector.y - actor.getHeight(), true) != null)
  12. return CANCEL;
  13. Vector2 stagePos = tabsPane.localToStageCoordinates(tmpVector.setZero());
  14. tmpRect.set(stagePos.x, stagePos.y, tabsPane.getGroup().getWidth(), tabsPane.getGroup().getHeight());
  15. if (tmpRect.contains(stageX, stageY) == false) return CANCEL;
  16. if (tabsPane.isHorizontalFlow() || tabsPane.isVerticalFlow()) {
  17. DRAG_POSITION.set(stageX, stageY);
  18. tabsPane.addActor(actor);
  19. return APPROVE;
  20. }
  21. return CANCEL;
  22. }
  23. });

相关文章