~w-shackleton/droidpad-android/stable

« back to all changes in this revision

Viewing changes to src/uk/digitalsquid/droidpad/buttons/Button.java

  • Committer: William Shackleton
  • Date: 2013-04-12 14:42:12 UTC
  • mfrom: (51.3.5 json)
  • mto: This revision was merged to the branch mainline in revision 52.
  • Revision ID: w.shackleton@gmail.com-20130412144212-4f7pueqwee0lc3yd
Imported code to load JSON layouts

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
package uk.digitalsquid.droidpad.buttons;
18
18
 
19
 
import android.graphics.Canvas;
20
 
import android.graphics.Point;
21
 
import android.graphics.RectF;
 
19
import android.graphics.Canvas;
 
20
import android.graphics.PointF;
 
21
import android.graphics.RectF;
22
22
 
23
23
public class Button extends Item {
24
24
        private static final long serialVersionUID = -7921469580817352801L;
45
45
                this.text = text;
46
46
                this.textSize = textSize == 0 ?  TEXT_SIZE : textSize;
47
47
        }
 
48
        public Button(float x, float y, float sx, float sy, boolean free, String text, int textSize) {
 
49
                super(x, y, sx, sy, free);
 
50
                this.text = text;
 
51
                this.textSize = textSize == 0 ?  TEXT_SIZE : textSize;
 
52
        }
48
53
 
49
54
        @Override
50
 
        public void drawInArea(Canvas c, RectF area, Point centre, boolean landscape) {
 
55
        public void drawInArea(Canvas c, RectF area, PointF centre, boolean landscape) {
51
56
                pTextS.setTextSize(textSize);
52
57
                pText.setTextSize(textSize);
53
58
                if(landscape) {
78
83
        }
79
84
 
80
85
        @Override
81
 
        public void onMouseOn(float x, float y) {
 
86
        public void onMouseOn(ScreenInfo info, float x, float y) {
82
87
                tmpSelected = true;
83
88
        }
84
89