comparison game/IDMButton.java @ 64:bca0112851d6

Only load button graphics once.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 25 Feb 2011 07:27:18 +0200
parents f81f76458b92
children b586ce4f6d97
comparison
equal deleted inserted replaced
63:1c7a97d80120 64:bca0112851d6
38 this(new IDMPoint(x, y), keyCode, font, text); 38 this(new IDMPoint(x, y), keyCode, font, text);
39 } 39 }
40 40
41 private static void loadImages() 41 private static void loadImages()
42 { 42 {
43 if (imgUp != null && imgPressed != null)
44 return;
45
43 try 46 try
44 { 47 {
45 ResourceLoader res = new ResourceLoader("graphics/button1_up.png"); 48 ResourceLoader res = new ResourceLoader("graphics/button1_up.png");
46 imgUp = ImageIO.read(res.getStream()); 49 imgUp = ImageIO.read(res.getStream());
47 50