31 lines
		
	
	
		
			808 B
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			808 B
		
	
	
	
		
			Java
		
	
	
	
	
	
| package electrosphere.entity;
 | |
| 
 | |
| import electrosphere.renderer.actor.Actor;
 | |
| 
 | |
| /**
 | |
|  * Utilities to manipulating drawable entities (eg making an entity transparent)
 | |
|  */
 | |
| public class DrawableUtils {
 | |
|     
 | |
|     /**
 | |
|      * Edits entity data to make the entity transparent
 | |
|      * @param entity The entity to edit
 | |
|      */
 | |
|     public static void makeEntityTransparent(Entity entity){
 | |
|         entity.putData(EntityDataStrings.DRAW_TRANSPARENT_PASS, true);
 | |
|         entity.removeData(EntityDataStrings.DRAW_SOLID_PASS);
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * Disables culling for the actor on a given entity
 | |
|      * @param entity The entity
 | |
|      */
 | |
|     public static void disableCulling(Entity entity){
 | |
|         Actor actor = EntityUtils.getActor(entity);
 | |
|         if(actor != null){
 | |
|             actor.setFrustumCull(false);
 | |
|         }
 | |
|     }
 | |
| 
 | |
| }
 |