public static CGRect fromDictionary(NSDictionary<NSString, NSNumber> dict) { CGRect r = new CGRect(); if (!fromDictionary(dict, r)) { throw new IllegalArgumentException("Failed to create CGRect from dictionary " + dict); } return r; }
private void createDefaultTextField () { textfield = new UITextField(new CGRect(10, 10, 100, 50)); //Parameters // Setting parameters textfield.setKeyboardType(UIKeyboardType.Default); textfield.setReturnKeyType(UIReturnKeyType.Done); textfield.setAutocapitalizationType(UITextAutocapitalizationType.None); textfield.setAutocorrectionType(UITextAutocorrectionType.No); textfield.setSpellCheckingType(UITextSpellCheckingType.No); textfield.setHidden(true); // Text field needs to have at least one symbol - so we can use backspace textfield.setText("x"); app.getUIViewController().getView().addSubview(textfield); }
private void createDefaultTextField () { textfield = new UITextField(new CGRect(10, 10, 100, 50)); //Parameters // Setting parameters textfield.setKeyboardType(UIKeyboardType.Default); textfield.setReturnKeyType(UIReturnKeyType.Done); textfield.setAutocapitalizationType(UITextAutocapitalizationType.None); textfield.setAutocorrectionType(UITextAutocorrectionType.No); textfield.setSpellCheckingType(UITextSpellCheckingType.No); textfield.setHidden(true); // Text field needs to have at least one symbol - so we can use backspace textfield.setText("x"); app.getUIViewController().getView().addSubview(textfield); }
return lastScreenBounds = new CGRect(0.0, statusBarHeight, screenWidth, screenHeight);
return lastScreenBounds = new CGRect(0.0, statusBarHeight, screenWidth, screenHeight);
view = new GLKView(new CGRect(0, 0, bounds.getWidth(), bounds.getHeight()), context) { @Method(selector = "touchesBegan:withEvent:") public void touchesBegan (@Pointer long touches, UIEvent event) {
view = new GLKView(new CGRect(0, 0, bounds.getWidth(), bounds.getHeight()), context) { @Method(selector = "touchesBegan:withEvent:") public void touchesBegan (@Pointer long touches, UIEvent event) {
@Override public Canvas clear() { bctx.clearRect(new CGRect(0, 0, texWidth, texHeight)); isDirty = true; return this; }
public static CGRect fromDictionary(NSDictionary<NSString, NSNumber> dict) { CGRect r = new CGRect(); if (!fromDictionary(dict, r)) { throw new IllegalArgumentException("Failed to create CGRect from dictionary " + dict); } return r; }
@Override public Canvas clearRect(float x, float y, float width, float height) { bctx.clearRect(new CGRect(x, y, width, height)); isDirty = true; return this; }
@Override public Canvas clearRect(float x, float y, float width, float height) { bctx.clearRect(new CGRect(x, y, width, height)); isDirty = true; return this; }
@Override public Canvas strokeCircle(float x, float y, float radius) { bctx.strokeEllipseInRect(new CGRect(x-radius, y-radius, 2*radius, 2*radius)); isDirty = true; return this; }
public static CGRect fromDictionary(NSDictionary<NSString, NSNumber> dict) { CGRect r = new CGRect(); if (!fromDictionary(dict, r)) { throw new IllegalArgumentException("Failed to create CGRect from dictionary " + dict); } return r; }
@Override public Canvas clipRect(float x, float y, float width, float height) { bctx.clipToRect(new CGRect(x, y, width, height)); return this; }
@Override public Canvas strokeCircle(float x, float y, float radius) { bctx.strokeEllipseInRect(new CGRect(x-radius, y-radius, 2*radius, 2*radius)); isDirty = true; return this; }
@Override public Canvas strokeRect(float x, float y, float width, float height) { bctx.strokeRect(new CGRect(x, y, width, height)); isDirty = true; return this; }
@Override public Canvas strokeRect(float x, float y, float width, float height) { bctx.strokeRect(new CGRect(x, y, width, height)); isDirty = true; return this; }
@Override public void draw(Object ctx, float x, float y, float width, float height) { CGBitmapContext bctx = (CGBitmapContext)ctx; // pesky fiddling to cope with the fact that UIImages are flipped; TODO: make sure drawing a // canvas image on a canvas image does the right thing y += height; bctx.saveGState(); bctx.translateCTM(x, y); bctx.scaleCTM(1, -1); bctx.drawImage(new CGRect(0, 0, width, height), cgImage()); bctx.restoreGState(); }
@Override public void draw(CGBitmapContext bctx, float x, float y, float width, float height) { CGImage cgImage = cgImage(); // pesky fiddling to cope with the fact that UIImages are flipped; TODO: make sure drawing a // canvas image on a canvas image does the right thing y += height; bctx.saveGState(); bctx.translateCTM(x, y); bctx.scaleCTM(1, -1); bctx.drawImage(new CGRect(0, 0, width, height), cgImage); bctx.restoreGState(); }
@Override protected Pattern toSubPattern(AbstractImageGL<?> image, boolean repeatX, boolean repeatY, float x, float y, float width, float height) { // this is a circuitous route, but I'm not savvy enough to find a more direct one CGImage subImage = CGImage.createWithImageInRect(cgImage(), new CGRect(x, y, width, height)); return new RoboPattern(image, UIColor.fromPatternImage(new UIImage(subImage)).getCGColor(), repeatX, repeatY); }