/** * Configures the default scale to use for assets. This allows one to specify an intermediate * graphics scale (like 1.5) and scale the 2x imagery down to 1.5x instead of scaling the 1.5x * imagery up (or displaying nothing at all). */ public void setAssetScale(float scaleFactor) { this.assetScale = new Scale(scaleFactor); }
/** * Configures the default scale to use for assets. This allows one to specify an intermediate * graphics scale (like 1.5) and scale the 2x imagery down to 1.5x instead of scaling the 1.5x * imagery up (or displaying nothing at all). */ public void setAssetScale(float scaleFactor) { this.assetScale = new Scale(scaleFactor); }
/** * Configures the default scale to use for assets. This allows one to use higher resolution * imagery than the device might normally. For example, one can supply scale 2 here, and * configure the graphics scale to 1.25 in order to use iOS Retina graphics (640x960) on a WXGA * (480x800) device. */ public void setAssetScale(float scaleFactor) { this.assetScale = new Scale(scaleFactor); }
/** * Configures the default scale to use for assets. This allows one to use higher resolution * imagery than the device might normally. For example, one can supply scale 2 here, and * configure the graphics scale to 1.25 in order to use iOS Retina graphics (640x960) on a WXGA * (480x800) device. */ public void setAssetScale(float scaleFactor) { this.assetScale = new Scale(scaleFactor); }
/** * Configures the default scale to use for assets. This allows one to specify an intermediate * graphics scale (like 1.5) and scale the 2x imagery down to 1.5x instead of scaling the 1.5x * imagery up (or displaying nothing at all). */ public void setAssetScale(float scaleFactor) { this.assetScale = new Scale(scaleFactor); }
protected GLContext(AbstractPlatform platform, float scaleFactor) { this.scale = new Scale(scaleFactor); this.platform = platform; }
/** * Returns an ordered series of scaled resources to try when loading an asset. The highest * resolution will be tried first, then half that resolution and so forth down to a normal * resolution image. In general this is simply {@code 2, 1}, but on a Retina iPad, it could be * {@code 4, 2, 1}. */ public List<ScaledResource> getScaledResources(String path) { List<ScaledResource> rsrcs = new ArrayList<ScaledResource>(); rsrcs.add(new ScaledResource(this, computePath(path, factor))); for (float rscale = MathUtil.ifloor(factor); rscale > 1; rscale -= 1) { if (rscale != factor) rsrcs.add( new ScaledResource(new Scale(rscale), computePath(path, rscale))); } rsrcs.add(new ScaledResource(ONE, path)); return rsrcs; }
public HtmlGraphicsCanvas(HtmlPlatform.Config config) { super(config); scale = new Scale(config.scaleFactor); rootLayer = new GroupLayerCanvas(createXform());