Package pu.web.client

Examples of pu.web.client.PU_Rect


    if(mScrollbar != null)
    {
      scrollInc = mScrollbar.getValue();
    }
   
    PU_Rect realRect = new PU_Rect(getRect().x + drawArea.x, getRect().y + drawArea.y, getRect().width, getRect().height);
    PU_Rect inRect = drawArea.intersection(realRect);
   
    int drawX = realRect.x + 3;
    int drawY = realRect.y + 3;
   
    for(int line = scrollInc; line < (visibleLines + scrollInc); line++)
View Full Code Here


                {
                  hpbarImage = PUWeb.resources().getGuiImage(GuiImages.IMG_GUI_WORLD_HPBAR_RED);
                }
                if(hpbarImage != null)
                {
                  hpbarImage.drawRect(new PU_Rect(256+(i*(pokemonSlot.getWidth()+2)), 19, (int)Math.ceil((float)hpperc * hpbarImage.getWidth()), hpbarImage.getHeight()));
                }
               
                PU_Image expbarImage = PUWeb.resources().getGuiImage(GuiImages.IMG_GUI_WORLD_HPBAR_EXP);
                if(expbarImage != null)
                {
                  expbarImage.drawRect(new PU_Rect(256+(i*(pokemonSlot.getWidth()+2)), 29, (int)Math.ceil(((float)pokemon.getExpPerc()/100.0f) * expbarImage.getWidth()), expbarImage.getHeight()));
                }
              }
            }
            PUWeb.engine().endTextureBatch()
          }
View Full Code Here

  @Override
  public void draw(PU_Rect drawArea)
  {
    if(isVisible() && inDrawArea(drawArea))
    {
      PU_Rect childDrawArea = new PU_Rect(drawArea);
      childDrawArea.x += getRect().x;
      childDrawArea.y += getRect().y;
      childDrawArea.width = getRect().width;
      childDrawArea.height = getRect().height;
     
View Full Code Here

  private boolean mFocus = false;
  private boolean mFocusable = false;
 
  public Element(int x, int y, int width, int height)
  {
    mRect = new PU_Rect(x, y, width, height);
    mVisible = true;
  }
View Full Code Here

  }
 
  @Override
  public void draw(PU_Rect drawArea)
  {
    PU_Rect realRect = new PU_Rect(getRect().x + drawArea.x, getRect().y + drawArea.y, getRect().width, getRect().height);
    PU_Rect inRect = drawArea.intersection(realRect);
   
    PU_Image drawable = null;
    if(mMouseDown && mImage.getMouseDownImage() != null)
    {
      drawable = mImage.getMouseDownImage();
View Full Code Here

  }
 
  @Override
  public void draw(PU_Rect drawArea)
  {
    PU_Rect realRect = new PU_Rect(getRect().x + drawArea.x, getRect().y + drawArea.y, getRect().width, getRect().height);
    PU_Rect inRect = drawArea.intersection(realRect);
   
    PU_Font font = getFont();
    if(font != null)
    {
      font.setColor(getFontColor().r, getFontColor().g, getFontColor().b);
View Full Code Here

  @Override
  public void draw(PU_Rect drawArea)
  {
    if(mBackgroundColor != null)
    {
      PU_Rect realRect = new PU_Rect(getRect().x + drawArea.x, getRect().y + drawArea.y, getRect().width, getRect().height);
      PU_Rect inRect = drawArea.intersection(realRect);
     
      PUWeb.engine().setColor(mBackgroundColor.getColor().r, mBackgroundColor.getColor().g, mBackgroundColor.getColor().b, mBackgroundColor.getColor().a);
      PUWeb.engine().renderFillRect(inRect.x, inRect.y, inRect.width, inRect.height);
    }
   
View Full Code Here

  }
 
  @Override
  public void draw(PU_Rect drawArea)
  {
    PU_Rect realRect = new PU_Rect(getRect().x + drawArea.x, getRect().y + drawArea.y, getRect().width, getRect().height);
    PU_Rect inRect = drawArea.intersection(realRect);
   
    if(mBackgroundColor != null)
    {
      PUWeb.engine().setColor(mBackgroundColor.getColor().r, mBackgroundColor.getColor().g, mBackgroundColor.getColor().b, mBackgroundColor.getColor().a);
      PUWeb.engine().renderFillRect(inRect.x, inRect.y, inRect.width, inRect.height);
    }
   
    if(mBorderColor !=  null)
    {
      PUWeb.engine().setColor(mBorderColor.getColor().r, mBorderColor.getColor().g, mBorderColor.getColor().b, mBorderColor.getColor().a);
      PUWeb.engine().renderRect(inRect.x, inRect.y, inRect.width, inRect.height);
    }
   
    if(mImage.getImage() != null)
    {
      mImage.getImage().drawRectInRect(getRect(), drawArea);
    }
   
    PU_Font font = getFont();
    int caretX = 0;
    int textX = getRect().x + font.getStringWidth(" ");
    int textY = getRect().y + ((getRect().height/2)-(font.getLineHeight()/2));
    if(!mText.equals(""))
    {
      String drawText = "";
      if(mPassword)
      {
        for(int i = 0; i < mText.length(); i++)
        {
          drawText += "*";
        }
      }
      else
      {
        drawText = mText;
      }
     
      font.setColor(getFontColor().r, getFontColor().g, getFontColor().b);
      font.drawTextInRect(drawText, drawArea.x + textX, drawArea.y + textY, inRect);
     
      caretX = font.getStringWidth(drawText);
    }
   
    //draw caret
    if(mCaret && !mReadOnly && hasFocus())
    {
      caretX += textX;
      if(inRect.contains(drawArea.x+caretX, drawArea.y+textY))
      {
        PUWeb.engine().setColor(getFontColor().r, getFontColor().g, getFontColor().b, 255);
        PUWeb.engine().renderLine(drawArea.x+caretX, drawArea.y+textY, drawArea.x+caretX, drawArea.y+textY+font.getLineHeight());
      }
    }
View Full Code Here

   
    if(mOrientation == SCROLLBAR_VERTICAL)
    {
      btnLeftTop = new Button(0, 0, width, width, "");
      btnRightDown = new Button(0, height-width, width, width, "");
      scbScroller = new ScrollButton(0, width, width, width, new PU_Rect(0, width, width, height-(2*width)));
    }
    else
    {
      btnLeftTop = new Button(0, 0, height, height, "");
      btnRightDown = new Button(width-height, 0, height, height, "");
      scbScroller = new ScrollButton(height, 0, height, height, new PU_Rect(height, 0, height, width-(2*height)));
    }
   
    addChild(btnLeftTop);
    addChild(btnRightDown);
    addChild(scbScroller);
 
View Full Code Here

TOP

Related Classes of pu.web.client.PU_Rect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.