001package com.fs.starfarer.api.graphics; 002 003import java.awt.Color; 004 005public interface SpriteAPI { 006 007 void setBlendFunc(int src, int dest); 008 void setNormalBlend(); 009 void setAdditiveBlend(); 010 void setCenter(float x, float y); 011 void setSize(float width, float height); 012 float getAngle(); 013 void setAngle(float angle); 014 015 Color getColor(); 016 void setColor(Color color); 017 void setHeight(float height); 018 void setWidth(float width); 019 float getHeight(); 020 float getWidth(); 021 void bindTexture(); 022 int getTextureId(); 023 024 void renderAtCenter(float x, float y); 025 void render(float x, float y); 026 void renderRegionAtCenter(float x, float y, float tx, float ty, float tw, float th); 027 void renderRegion(float x, float y, float tx, float ty, float tw, float th); 028 029 float getCenterX(); 030 float getCenterY(); 031 032 float getAlphaMult(); 033 void setAlphaMult(float alphaMult); 034 035 036 /** 037 * Fraction of the OpenGL texture's width taken up by the image. 038 * OpenGL textures have width and height that are powers of 2, the image may not. 039 * @return 040 */ 041 float getTextureWidth(); 042 043 /** 044 * Fraction of the OpenGL texture's height taken up by the image. 045 * OpenGL textures have width and height that are powers of 2, the image may not. 046 * @return 047 */ 048 float getTextureHeight(); 049 050 051 void setCenterY(float cy); 052 void setCenterX(float cx); 053 054 Color getAverageColor(); 055 056 void setTexX(float texX); 057 void setTexY(float texY); 058 void setTexWidth(float texWidth); 059 void setTexHeight(float texHeight); 060 void renderWithCorners(float blX, float blY, float tlX, float tlY, float trX, float trY, float brX, float brY); 061 Color getAverageBrightColor(); 062 void renderNoBind(float x, float y); 063 void renderAtCenterNoBind(float x, float y); 064 int getBlendDest(); 065 int getBlendSrc(); 066 067 float getTexX(); 068 float getTexY(); 069 float getTexWidth(); 070 float getTexHeight(); 071}