Skip to content

Commit

Permalink
Added load bg. bar is next. also... i may redo all of the login scree…
Browse files Browse the repository at this point in the history
…n images... cause they are low res... and some of them pixelly. and the black is too overpowering. =/
  • Loading branch information
Lt.Sego authored and Lt.Sego committed Mar 29, 2010
1 parent c4487db commit e014c0c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Binary file added Client/res/load.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 16 additions & 8 deletions Client/src/org/pokenet/client/GameClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import mdes.slick.sui.Container;
import mdes.slick.sui.Display;
import mdes.slick.sui.Label;
import mdes.slick.sui.event.ActionEvent;
import mdes.slick.sui.event.ActionListener;

Expand All @@ -22,6 +23,7 @@
import org.newdawn.slick.AngelCodeFont;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.BigImage;
import org.newdawn.slick.Color;
import org.newdawn.slick.Font;
import org.newdawn.slick.GameContainer;
Expand Down Expand Up @@ -101,10 +103,10 @@ public class GameClient extends BasicGame {
private static boolean m_disableMaps = false;
public static String UDPCODE = "";

public static DeferredResource m_nextResource;
private boolean m_started;
public static DeferredResource m_nextResource;
private boolean m_started;

Color m_loadGreen = new Color(132,185,0);
Color m_loadColor = new Color(70,70,255);

private boolean m_close = false; //Used to tell the game to close or not.
private Image[] m_spriteImageArray = new Image[240]; /* WARNING: Replace with actual number of sprites */
Expand Down Expand Up @@ -165,7 +167,10 @@ public GameClient(String title) {
@Override
public void init(GameContainer gc) throws SlickException {
// gc.getGraphics().setBackground(Color.white);
m_loadImage = new Image("res/ui/pokeball.png");
m_loadImage = new Image("res/load.jpg");
// m_loadImage = m_loadImage.getScaledCopy(gc.getWidth() / m_loadImage.getWidth());
m_loadImage = m_loadImage.getScaledCopy(800.0f / m_loadImage.getWidth());


LoadingList.setDeferredLoading(true);

Expand All @@ -174,6 +179,8 @@ public void init(GameContainer gc) throws SlickException {
gc.getGraphics().setWorldClip(-32, -32, 832, 832);
gc.setShowFPS(false);
m_display = new Display(gc);



/*
* Setup variables
Expand Down Expand Up @@ -394,7 +401,9 @@ public void update(GameContainer gc, int delta) throws SlickException {
* Renders to the game window
*/
public void render(GameContainer gc, Graphics g) throws SlickException {
if (m_nextResource != null) {
g.drawImage(m_loadImage, 0, 0);

if (m_nextResource != null) {
g.setColor(Color.white);
g.drawString("Loading: "+m_nextResource.getDescription(), 10, gc.getHeight() - 90);
}
Expand All @@ -403,12 +412,11 @@ public void render(GameContainer gc, Graphics g) throws SlickException {
int maxWidth = gc.getWidth() - 20;
int loaded = LoadingList.get().getTotalResources() - LoadingList.get().getRemainingResources();
if(!m_started){
g.drawImage(m_loadImage, gc.getWidth() / 2 - m_loadImage.getWidth() / 2, gc.getHeight() / 2 - m_loadImage.getHeight());


float bar = loaded / (float) total;

// non-imagy loading bar
g.setColor(m_loadGreen);
g.setColor(m_loadColor);
g.setAntiAlias(true);
g.fillRoundRect(15, gc.getHeight() - 120, bar*(maxWidth - 10), 20, 10);
g.setColor(Color.gray);
Expand Down

0 comments on commit e014c0c

Please sign in to comment.