Tabnine Logo
Platform.graphics
Code IndexAdd Tabnine to your IDE (free)

How to use
graphics
method
in
playn.core.Platform

Best Java code snippets using playn.core.Platform.graphics (Showing top 20 results out of 315)

origin: threerings/playn

/**
 * Returns the {@link Graphics} service.
 */
public static Graphics graphics() {
 return platform.graphics();
}
origin: threerings/tripleplay

/** Returns the size of this screen, for use by transitions.
 * Defaults to the size of the entire view. */
public IDimension size () { return _game.plat.graphics().viewSize; }
origin: threerings/tripleplay

public Hud (SceneGame game) {
  _game = game;
  layer = new CanvasLayer(game.plat.graphics(), 1, 1);
}
origin: threerings/tripleplay

/** Returns the size of this screen. This is used for transitions.
 * Defaults to the size of the entire view. */
public IDimension size () { return game().plat.graphics().viewSize; }
origin: threerings/tripleplay

public void update () {
  _layout = _game.plat.graphics().layoutText(String.valueOf(label.get()), _fmt);
}
public float labelWidth () { return 0; }
origin: threerings/tripleplay

/**
 * Creates a menu host using the given values. The root layer is set to the layer of the given
 * root and the stylesheet to its stylesheet.
 */
public MenuHost (Interface iface, Elements<?> root) {
  this(iface, root.layer);
  _stylesheet = root.stylesheet();
  _screenArea.setSize(iface.plat.graphics().viewSize);
}
origin: threerings/tripleplay

/** Called when this screen will potentially be shown.
 * Should create main UI and prepare it for display. */
public void wake () {
  _flags |= AWAKE;
  closeOnSleep(_game.plat.graphics().deviceOrient.connectNotify(
    new Slot<Graphics.Orientation>() {
      public void onEmit (Graphics.Orientation orient) {
        _sizeValue.updateForce(size());
      }
    }));
}
origin: threerings/tripleplay

/** Returns the stylesheet to use for this screen. */
protected Stylesheet stylesheet () {
  return SimpleStyles.newSheet(game().plat.graphics());
}
origin: threerings/tripleplay

/** Returns the stylesheet to use for this screen. */
protected Stylesheet stylesheet () {
  return SimpleStyles.newSheet(game().plat.graphics());
}
origin: threerings/tripleplay

@Override public void init (Platform plat, Screen oscreen, Screen nscreen) {
  super.init(plat, oscreen, nscreen);
  nscreen.layer.setDepth(-1);
  _obatch = new RotateYBatch(plat.graphics().gl, 0.5f, 0.5f, 1);
  oscreen.layer.setBatch(_obatch);
  _nbatch = new RotateYBatch(plat.graphics().gl, 0.5f, 0.5f, 1);
  nscreen.layer.setBatch(_nbatch);
}
origin: io.playn/playn-core

protected ImageImpl (Platform plat, boolean async, Scale preScale, int preWidth, int preHeight,
           String source) {
 this(plat.graphics(), async ? plat.exec().<Image>deferredPromise() : RPromise.<Image>create(),
    preScale, preWidth, preHeight, source);
}
origin: playn/playn

protected ImageImpl (Platform plat, boolean async, Scale preScale, int preWidth, int preHeight,
           String source) {
 this(plat.graphics(), async ? plat.exec().<Image>deferredPromise() : RPromise.<Image>create(),
    preScale, preWidth, preHeight, source);
}
origin: playn/playn

public SceneGame (Platform plat, int updateRate) {
 super(plat, updateRate);
 GL20 gl = plat.graphics().gl;
 gl.glDisable(GL20.GL_CULL_FACE);
 gl.glEnable(GL20.GL_BLEND);
 gl.glBlendFunc(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA);
 defaultBatch = createDefaultBatch(gl);
 viewSurf = new Surface(plat.graphics(), plat.graphics().defaultRenderTarget, defaultBatch);
 rootLayer = new RootLayer();
 paint.connect(new Slot<Clock>() {
  public void onEmit (Clock clock) { paintScene(); }
 }).atPrio(scenePaintPrio());
}
origin: threerings/tripleplay

public void update () {
  _vlayout = _game.plat.graphics().layoutText(String.valueOf(value.get()), _fmt);
  _size.setSize(llayout.size.width() + GAP + _vlayout.size.width(),
         Math.max(llayout.size.height(), _vlayout.size.height()));
}
public float labelWidth () { return llayout.size.width(); }
origin: threerings/tripleplay

@Override public Root setSize (float width, float height) {
  super.setSize(width, height);
  // update the image to the new size, if it's changed
  Texture old = _texture.get();
  if (old == null || old.displayWidth != width || old.displayHeight != height) {
    _texture.update(iface.plat.graphics().createTexture(width, height, textureConfig()));
  }
  return this;
}
origin: playn/playn

public DebugDrawBox2D(Platform plat, float width, float height) {
 super(new OBBViewportTransform());
 this.plat = plat;
 viewportTransform.setYFlip(true);
 strokeWidth = 1.0f;
 strokeAlpha = 255;
 fillAlpha = 150;
 canvas = plat.graphics().createCanvas(width, height);
 canvas.setStrokeWidth(strokeWidth);
 setStrokeColorFromCache();
 setFillColorFromCache();
}
origin: threerings/tripleplay

@Override protected void layout (LayoutData ldata, float left, float top,
                 float width, float height) {
  super.layout(ldata, left, top, width, height);
  // prepare the glyph
  if (width == 0 && height == 0) {
    _glyph.close();
    return;
  }
  _glyph.prepare(root().iface.plat.graphics(), width, height);
  _glyph.layer().setTranslation(left, top);
  render();
}
origin: threerings/tripleplay

  @Override public void setPosition (float x, float y) {
    Root root = root();
    if (root != null) {
      Scale scale = root.iface.plat.graphics().scale();
      if (hrange.active()) x = scale.roundToNearestPixel(x);
      if (vrange.active()) y = scale.roundToNearestPixel(y);
    }
    Scroller.this.content.layer.setTranslation(x, y);
  }
};
origin: threerings/tripleplay

@Override public void layout () {
  super.layout();
  Texture texture = _texture.get();
  TextureSurface surf = new TextureSurface(iface.plat.graphics(), _defaultBatch, texture);
  surf.begin().clear();
  layer.paint(surf);
  surf.end().close();
}
origin: threerings/tripleplay

/** Called when a screen becomes the top screen, and is therefore made visible. */
public void wasShown () {
  closeOnHide(game().update.connect(update.slot()));
  closeOnHide(game().paint.connect(paint.slot()));
  closeOnHide(game().plat.graphics().deviceOrient.connectNotify(
    new Slot<Graphics.Orientation>() {
      public void onEmit (Graphics.Orientation orient) {
        _sizeValue.updateForce(size());
      }
    }));
}
playn.corePlatformgraphics

Javadoc

Returns the Graphics service.

Popular methods of Platform

  • log
    Returns the Log service.
  • assets
    Returns the Assets service.
  • input
    Returns the Input service.
  • invokeLater
  • exec
    Returns the Exec service.
  • json
    Returns the Json service.
  • storage
    Returns the Storage storage service.
  • time
    Returns the current time, as a double value in millis since January 1, 1970, 00:00:00 GMT. This is e
  • type
    Returns the platform Platform.Type.
  • net
    Returns the Net service.
  • reportError
    Called when a backend (or other framework code) encounters an exception that it can recover from, bu
  • setPropagateEvents
  • reportError,
  • setPropagateEvents,
  • tick,
  • audio,
  • dispatchEvent,
  • keyboard,
  • mouse,
  • openURL,
  • pointer

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now