SHARE
TWEET

Untitled

nemo9955 Sep 3rd, 2014 6 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.nemo9955.starting_fire.game.ashley;
  2.  
  3. import com.badlogic.ashley.core.ComponentMapper;
  4. import com.badlogic.ashley.core.Entity;
  5. import com.badlogic.ashley.core.Family;
  6. import com.badlogic.ashley.systems.IteratingSystem;
  7. import com.nemo9955.starting_fire.storage.SF;
  8.  
  9. public class RenderSystem extends IteratingSystem {
  10.  
  11.         private ComponentMapper<CPosition>      cp              = ComponentMapper.getFor(CPosition.class);
  12.         private ComponentMapper<CTexture>       ct              = ComponentMapper.getFor(CTexture.class);
  13.         // private ComponentMapper<CWorld> cw = ComponentMapper.getFor(CWorld.class);
  14.  
  15.         public boolean                                          render  = true;
  16.  
  17.         @SuppressWarnings("unchecked")
  18.         public RenderSystem() {
  19.                 super(Family.getFor(CPosition.class, CTexture.class/* , CWorld.class */));
  20.                 System.out.println("created renderer");
  21.         }
  22.  
  23.         @Override
  24.         public void processEntity( Entity entity, float deltaTime ) {
  25.                 CPosition po = cp.get(entity);
  26.                 CTexture tex = ct.get(entity);
  27.                 // CWorld wo = cw.get(entity);
  28.  
  29.                 SF.spritesBatch.draw(tex.tex, po.x, po.y/* , wo.world.hexWidht, wo.world.hexHeight */);
  30.                 System.out.println("rendering entity !!!");
  31.         }
  32.  
  33.         @Override
  34.         public boolean checkProcessing() {
  35.                 return render;
  36.         }
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top