Tabnine Logo
com.badlogic.gdx.utils
Code IndexAdd Tabnine to your IDE (free)

How to use com.badlogic.gdx.utils

Best Java code snippets using com.badlogic.gdx.utils (Showing top 20 results out of 801)

origin: libgdx/libgdx

protected void startArray (String name) {
  JsonValue value = new JsonValue(ValueType.array);
  if (current != null) addChild(name, value);
  elements.add(value);
  current = value;
}
origin: libgdx/libgdx

  public StringBuilder toString (final StringBuilder sb) {
    sb.setLength(0);
    for (int i = 0; i < counters.size; i++) {
      if (i != 0) sb.append("; ");
      counters.get(i).toString(sb);
    }
    return sb;
  }
}
origin: libgdx/libgdx

public void reset () {
  Pools.get(GlyphRun.class).freeAll(runs);
  runs.clear();
  width = 0;
  height = 0;
}
origin: libgdx/libgdx

@Override
public void onGamepadDisconnected (int index) {
  GwtController controller = controllerMap.remove(index);
  if (controller != null) {
    synchronized (eventQueue) {
      GwtControllerEvent event = eventPool.obtain();
      event.type = GwtControllerEvent.DISCONNECTED;
      event.controller = controller;
      eventQueue.add(event);
    }
  }
}
origin: libgdx/libgdx

public JsonWriter array () throws IOException {
  requireCommaOrName();
  stack.add(current = new JsonObject(true));
  return this;
}
origin: libgdx/libgdx

/** Remove all decals from batch */
protected void clear () {
  groupList.clear();
  groupPool.freeAll(usedGroups);
  usedGroups.clear();
}
origin: libgdx/libgdx

/** Clears the data being built up until now, including the vertices, indices and all parts. Must be called in between the call
 * to #begin and #end. Any builder calls made from the last call to #begin up until now are practically discarded. The state
 * (e.g. UV region, color, vertex transform) will remain unchanged. */
public void clear () {
  this.vertices.clear();
  this.indices.clear();
  this.parts.clear();
  this.vindex = 0;
  this.lastIndex = -1;
  this.istart = 0;
  this.part = null;
}
origin: libgdx/libgdx

/** Removes all glyphs in the cache. */
public void clear () {
  x = 0;
  y = 0;
  Pools.freeAll(pooledLayouts, true);
  pooledLayouts.clear();
  layouts.clear();
  for (int i = 0, n = idx.length; i < n; i++) {
    if (pageGlyphIndices != null) pageGlyphIndices[i].clear();
    idx[i] = 0;
  }
}
origin: libgdx/libgdx

/** @param type May be null if the type is unknown.
 * @return May be null. */
public <T> T fromJson (Class<T> type, FileHandle file) {
  try {
    return (T)readValue(type, null, new JsonReader().parse(file));
  } catch (Exception ex) {
    throw new SerializationException("Error reading file: " + file, ex);
  }
}
origin: libgdx/libgdx

public void writeObjectStart (String name) {
  try {
    writer.name(name);
  } catch (IOException ex) {
    throw new SerializationException(ex);
  }
  writeObjectStart();
}
origin: libgdx/libgdx

/** Starts writing an object, writing the actualType to a field if needed.
 * @param knownType May be null if the type is unknown. */
public void writeObjectStart (Class actualType, Class knownType) {
  try {
    writer.object();
  } catch (IOException ex) {
    throw new SerializationException(ex);
  }
  if (knownType == null || knownType != actualType) writeType(actualType);
}
origin: libgdx/libgdx

protected void startObject (String name) {
  JsonValue value = new JsonValue(ValueType.object);
  if (current != null) addChild(name, value);
  elements.add(value);
  current = value;
}
origin: libgdx/libgdx

  public StringBuilder toString (final StringBuilder sb) {
    sb.setLength(0);
    for (int i = 0; i < counters.size; i++) {
      if (i != 0) sb.append("; ");
      counters.get(i).toString(sb);
    }
    return sb;
  }
}
origin: libgdx/libgdx

public JsonWriter object () throws IOException {
  requireCommaOrName();
  stack.add(current = new JsonObject(false));
  return this;
}
origin: libgdx/libgdx

public void reset () {
  Pools.get(GlyphRun.class).freeAll(runs);
  runs.clear();
  width = 0;
  height = 0;
}
origin: libgdx/libgdx

/** Removes all glyphs in the cache. */
public void clear () {
  x = 0;
  y = 0;
  Pools.freeAll(pooledLayouts, true);
  pooledLayouts.clear();
  layouts.clear();
  for (int i = 0, n = idx.length; i < n; i++) {
    if (pageGlyphIndices != null) pageGlyphIndices[i].clear();
    idx[i] = 0;
  }
}
origin: libgdx/libgdx

/** @param type May be null if the type is unknown.
 * @return May be null. */
public <T> T fromJson (Class<T> type, FileHandle file) {
  try {
    return (T)readValue(type, null, new JsonReader().parse(file));
  } catch (Exception ex) {
    throw new SerializationException("Error reading file: " + file, ex);
  }
}
origin: libgdx/libgdx

/** @param knownType May be null if the type is unknown. */
public void writeObjectStart (String name, Class actualType, Class knownType) {
  try {
    writer.name(name);
  } catch (IOException ex) {
    throw new SerializationException(ex);
  }
  writeObjectStart(actualType, knownType);
}
origin: libgdx/libgdx

protected void startObject (String name) {
  JsonValue value = new JsonValue(ValueType.object);
  if (current != null) addChild(name, value);
  elements.add(value);
  current = value;
}
origin: libgdx/libgdx

/** @param type May be null if the type is unknown.
 * @param elementType May be null if the type is unknown.
 * @return May be null. */
public <T> T fromJson (Class<T> type, Class elementType, FileHandle file) {
  try {
    return (T)readValue(type, elementType, new JsonReader().parse(file));
  } catch (Exception ex) {
    throw new SerializationException("Error reading file: " + file, ex);
  }
}
com.badlogic.gdx.utils

Most used classes

  • Array
    A resizable, ordered or unordered array of objects. If unordered, this class avoids a memory copy wh
  • GdxRuntimeException
    Typed runtime exception used throughout libgdx
  • ObjectMap
    An unordered map. This implementation is a cuckoo hash map using 3 hashes, random walking, and a sma
  • Pool
    A pool of objects that can be reused to avoid allocation.
  • IntArray
    A resizable, ordered or unordered int array. Avoids the boxing that occurs with ArrayList. If unorde
  • IntMap,
  • BufferUtils,
  • Viewport,
  • JsonValue,
  • ClassReflection,
  • Json,
  • JsonReader,
  • FloatArray,
  • TimeUtils,
  • LongMap,
  • Timer,
  • ObjectSet,
  • SnapshotArray,
  • StringBuilder
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