List of usage examples for com.google.gwt.canvas.dom.client Context2d createPattern
public final native CanvasPattern createPattern(ImageElement image, String repetition) ;
From source file:playn.html.HtmlPattern.java
License:Apache License
public CanvasPattern pattern(Context2d ctx, boolean repeatX, boolean repeatY) { Context2d.Repetition repeat;//from ww w. ja v a2 s . c o m if (repeatX) { if (repeatY) { repeat = Context2d.Repetition.REPEAT; } else { repeat = Context2d.Repetition.REPEAT_X; } } else if (repeatY) { repeat = Context2d.Repetition.REPEAT_Y; } else { return null; } return ctx.createPattern(patimg, repeat); }