/** * get size * * @return */ public Float2 getSize() { return new Float2(s_width, s_height); }
@Override public Float2 adjustPosition(Float2 original) { Float2 modified = new Float2(original.x, original.y); modified.x += p_velX; modified.y += p_velY; return modified; }
public void setScale(float scale) { s_scale = new Float2(scale, scale); }
private void init() { b_text = ""; b_text_Color = Color.WHITE; b_button_Color = Color.TRANSPARENT; b_zoomCenter = false; b_firstInit = false; b_position = new Point(110, 110); b_scale = new Float2(1.0f, 1.0f); b_textPaint = new Paint(Paint.ANTI_ALIAS_FLAG); b_textPaint.setColor(b_text_Color); b_textPaint.setTextSize(40); paint.setColor(b_button_Color); paint.setAntiAlias(true); paint.setStyle(Paint.Style.FILL); }
private void init() { b_alpha = 255; zoomCenter = false; firstInit = false; texture = new GameTexture(b_engine); b_position = new Point(0, 0); b_scale = new Float2(1.0f, 1.0f); }
private void init() { s_alpha = 255; s_canvas = null; s_texture = new GameTexture(s_engine); s_paint = new Paint(); s_position = new Float2(0, 0); s_frame = 0; animMap = new ConcurrentHashMap<>(); animList = new CopyOnWriteArrayList<>(); s_scale = new Float2(1.0f, 1.0f); s_rotation = 0.0f; s_collidable = true; s_collided = false; s_alive = true; if (frameType == FrameType.COMMON) { s_frame_rect = new LinkedList<>(); } else if (frameType == FrameType.SIMPLE) { this.s_columns = 1; } s_dst = new Rect(); src = new Rect(); s_mat_translation = new Matrix(); s_mat_scale = new Matrix(); s_mat_rotate = new Matrix(); s_matrix = new Matrix(); s_paint.setColor(UIdefaultData.sprite_default_color_paint); }
public void setDipScale(int dipW, int dipH) { if (b_width == 0 || b_height == 0) { b_width = texture.getBitmap().getWidth(); b_height = texture.getBitmap().getHeight(); } setScale(new Float2(DisplayUtils.dip2px(dipW) * 1.0f / b_width, DisplayUtils.dip2px(dipH) * 1.0f / b_height)); }
public void setDipScale(int dipWidth, int dipHeight) { if (s_width == 0 || s_height == 0) { s_width = s_texture.getBitmap().getWidth(); s_height = s_texture.getBitmap().getHeight(); } setScale(new Float2(DisplayUtils.dip2px(dipWidth) / s_width, DisplayUtils.dip2px(dipHeight) / s_height)); }