|
|
|
@ -473,11 +473,11 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
|
Color currentCol = col; |
|
|
|
|
for (int i=0;i<finalS.length();i++) { |
|
|
|
|
if (finalS.charAt(i)=='\n') { |
|
|
|
|
xOffset+=(charCount+1)*f.getGlyphWidth(); |
|
|
|
|
yOffset+=f.getGlyphHeight(); |
|
|
|
|
xOffset+=(charCount+1)*f.getGlyphWidth()*scalex; |
|
|
|
|
yOffset+=f.getGlyphHeight()*scaley; |
|
|
|
|
charCount=0; |
|
|
|
|
} else { |
|
|
|
|
Draw_Sprite_Partial_Ext(x+i*f.getGlyphWidth()-xOffset, y+yOffset, f.getCharInfo(finalS.charAt(i)).getX(), f.getCharInfo(finalS.charAt(i)).getY(), f.getCharInfo(finalS.charAt(i)).getWidth(), f.getCharInfo(finalS.charAt(i)).getHeight(), f.getSprite(), currentCol,Transform.NONE,scalex,scaley); |
|
|
|
|
Draw_Sprite_Partial_Ext(x+(i*f.getGlyphWidth())*scalex-xOffset, y+yOffset, f.getCharInfo(finalS.charAt(i)).getX(), f.getCharInfo(finalS.charAt(i)).getY(), f.getCharInfo(finalS.charAt(i)).getWidth(), f.getCharInfo(finalS.charAt(i)).getHeight(), f.getSprite(), currentCol,Transform.NONE,scalex,scaley); |
|
|
|
|
charCount++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -561,9 +561,9 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
|
public void Draw_Sprite(double x, double y, Sprite sprite, Color col, Transform transform, int scalex, int scaley){ |
|
|
|
|
Draw_Sprite_Partial_Ext(x,y,0,0,sprite.getWidth(),sprite.getHeight(),sprite,col,transform,scalex,scaley); |
|
|
|
|
} |
|
|
|
|
public void Draw_Animated_Sprite(double x, double y, AnimatedSprite sprite, double frameIndex, Color col, Transform transform){ |
|
|
|
|
public void Draw_Animated_Sprite(double x, double y, AnimatedSprite sprite, double frameIndex, Color col, Transform transform, int scalex, int scaley){ |
|
|
|
|
Rectangle frameRectangle=sprite.getFrame((int)frameIndex); |
|
|
|
|
Draw_Sprite_Partial(x,y,frameRectangle.getX(),frameRectangle.getY(),frameRectangle.getWidth(),frameRectangle.getHeight(),sprite,col,transform); |
|
|
|
|
Draw_Sprite_Partial_Ext(x,y,frameRectangle.getX(),frameRectangle.getY(),frameRectangle.getWidth(),frameRectangle.getHeight(),sprite,col,transform,scalex,scaley); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void Draw_Sprite_Partial(double x, double y, double xOffset, double yOffset, double w, double h, Sprite sprite, Color col, Transform transform){ |
|
|
|
@ -580,7 +580,7 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
|
boolean vertical = transform==Transform.VERTICAL||transform==Transform.HORIZ_VERTIC; |
|
|
|
|
for(int X=(int)xOffset;X<(int)(w+xOffset);X++){ |
|
|
|
|
for(int Y=(int)yOffset;Y<(int)(h+yOffset);Y++){ |
|
|
|
|
if (X+x-xOffset<0||Y+y-yOffset<0||X-xOffset+x>=ACTUAL_WINDOW_WIDTH||Y-yOffset+y>=ACTUAL_WINDOW_HEIGHT) { |
|
|
|
|
if (x+(X-xOffset)*scalex<0||y+(Y-yOffset)*scaley<0||(X-xOffset)*scalex+x>=ACTUAL_WINDOW_WIDTH||(Y-yOffset)*scaley+y>=ACTUAL_WINDOW_HEIGHT) { |
|
|
|
|
continue; |
|
|
|
|
} else { |
|
|
|
|
int index = |
|
|
|
@ -590,7 +590,7 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
|
+(int)y)*ACTUAL_WINDOW_WIDTH+ |
|
|
|
|
(horizontal? |
|
|
|
|
sprite.getWidth()-(X-(int)xOffset): |
|
|
|
|
(X-(int)xOffset))*scalex |
|
|
|
|
(X-(int)xOffset)*scalex) |
|
|
|
|
+(int)x; |
|
|
|
|
if (((sprite.getImg().getRGB(X,Y)>>>24)&0xFF)==0||index<0||index>=pixel.length) { |
|
|
|
|
continue; |
|
|
|
@ -598,9 +598,9 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
|
if (col==Color.WHITE) { |
|
|
|
|
for (int XX=0;XX<scalex;XX++) { |
|
|
|
|
int newindex=index; |
|
|
|
|
newindex+=XX+X*scalex; |
|
|
|
|
newindex+=XX; //Everytime we reset we move the X marker over.
|
|
|
|
|
for (int YY=0;YY<scaley;YY++) { |
|
|
|
|
newindex+=(YY+Y*scaley)*ACTUAL_WINDOW_WIDTH; |
|
|
|
|
newindex+=ACTUAL_WINDOW_WIDTH; //The Y marker only moves one pixel down at a time, because we do not reset it.
|
|
|
|
|
Draw(newindex,sprite.getImg().getRGB(X,Y)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -608,9 +608,9 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
|
Color img = new Color(sprite.getImg().getRGB(X,Y)); |
|
|
|
|
for (int XX=0;XX<scalex;XX++) { |
|
|
|
|
int newindex=index; |
|
|
|
|
newindex+=XX+X*scalex; |
|
|
|
|
newindex+=XX; //Everytime we reset we move the X marker over.
|
|
|
|
|
for (int YY=0;YY<scaley;YY++) { |
|
|
|
|
newindex+=(YY+Y*scaley)*ACTUAL_WINDOW_WIDTH; |
|
|
|
|
newindex+=ACTUAL_WINDOW_WIDTH; //The Y marker only moves one pixel down at a time, because we do not reset it.
|
|
|
|
|
Draw(newindex,new Color( |
|
|
|
|
(int)Math.min(255.0f,Math.max(0,(float)img.r * col.r / 255.0f)), |
|
|
|
|
(int)Math.min(255.0f,Math.max(0,(float)img.g * col.g / 255.0f)), |
|
|
|
|