Пример #1
0
  /**
   * Creates a button using provided entities as faces representing Button states
   *
   * @note Supplied entities will be moved to the center of Button
   * @param pNormal
   * @param pPressed
   * @param pDisabled
   */
  public Button(final IEntity pNormal, final IEntity pPressed, final IEntity pDisabled) {

    setSize(pNormal.getWidth(), pNormal.getHeight());
    if (pNormal == null) {
      throw new AndEngineRuntimeException("pNormal button face is null");
    }

    this.mEntities[State.NORMAL.getEntityIndex()] = pNormal;
    this.mEntities[State.PRESSED.getEntityIndex()] = pPressed;
    this.mEntities[State.DISABLED.getEntityIndex()] = pDisabled;

    this.mState = State.NORMAL;
    positionEntities();
  }
 @Override
 public String getAriaDisabledState(Element element) {
   return State.DISABLED.get(element);
 }
 @Override
 public void setAriaDisabledState(Element element, boolean value) {
   State.DISABLED.set(element, value);
 }
 @Override
 public void removeAriaDisabledState(Element element) {
   State.DISABLED.remove(element);
 }