Advertisement
Nolesh

LibGDX MyLazyImageList2

Apr 17th, 2013
572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 19.53 KB | None | 0 0
  1. package ru.nolesh.libgdx.extension;
  2.  
  3. import java.io.DataInputStream;
  4. import java.io.IOException;
  5. import java.io.InputStream;
  6. import java.net.HttpURLConnection;
  7. import java.net.MalformedURLException;
  8. import java.net.URL;
  9. import java.util.ArrayList;
  10. import java.util.HashMap;
  11. import java.util.List;
  12. import java.util.Map;
  13.  
  14. import com.badlogic.gdx.Gdx;
  15. import com.badlogic.gdx.graphics.Color;
  16. import com.badlogic.gdx.graphics.Pixmap;
  17. import com.badlogic.gdx.graphics.Texture;
  18. import com.badlogic.gdx.graphics.g2d.BitmapFont;
  19. import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
  20. import com.badlogic.gdx.graphics.g2d.SpriteBatch;
  21. import com.badlogic.gdx.scenes.scene2d.InputEvent;
  22. import com.badlogic.gdx.scenes.scene2d.InputListener;
  23. import com.badlogic.gdx.scenes.scene2d.ui.List.ListStyle;
  24. import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
  25. import com.badlogic.gdx.scenes.scene2d.ui.Widget;
  26. import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent;
  27. import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
  28. import com.badlogic.gdx.utils.GdxRuntimeException;
  29. import com.badlogic.gdx.utils.Pools;
  30.  
  31. /**
  32.  * Extended list with headers. It allows to load images from URL in lazy mode.
  33.  * @author Nolesh
  34.  */
  35. public class MyLazyImageList2 extends ScrollPane{
  36.        
  37.     public static final String SEPARATOR = "/*~*/";
  38.     private static final String SEPARATOR_TEMPLATE = "/\\*~\\*/";
  39.     private static final int MAX_THREAD_AMOUNT = 2;
  40.     private volatile static int threadAmount;
  41.    
  42.     private MyRawList rawList;
  43.     private boolean isEnabled;
  44.     private String emptyLabel;
  45.     private Texture placeholder;
  46.     private String headers[];
  47.     private Drawable headersBackground;
  48.     private Color headersColor;
  49.        
  50.     /**
  51.      * Constructor
  52.      * @param items To create items use MyLazyImageListItem.formItems(names, urls)
  53.      * @param style
  54.      * @param listStyle
  55.      * @param placeholder It must not be empty!  
  56.      */
  57.     public MyLazyImageList2(MyLazyImageListItem[] items, ScrollPaneStyle style,
  58.             ListStyle listStyle, Texture placeholder){     
  59.         super(null, style);
  60.         isEnabled = true;
  61.         rawList = new MyRawList(items, listStyle, this);
  62.         setWidget(rawList);
  63.         setWidth(rawList.getPrefWidth());
  64.         setHeight(rawList.getPrefHeight());
  65.         setScrollingDisabled(true, false); 
  66.         emptyLabel = "There are no any items";
  67.         if(placeholder==null)
  68.             throw new IllegalArgumentException("Placeholder must not be empty!");
  69.         this.placeholder=placeholder;      
  70.         threadAmount=0;
  71.     }
  72.                
  73.     public boolean isEnabled() {
  74.         return isEnabled;
  75.     }
  76.  
  77.     public void setEnabled(boolean isEnabled) {
  78.         this.isEnabled = isEnabled;    
  79.     }
  80.        
  81.     public void setItems(MyLazyImageListItem[] items){
  82.         rawList.setItems(items);
  83.     }
  84.        
  85.     public void setSelectedIndex(int index){
  86.         rawList.setSelectedIndex(index);
  87.     }
  88.    
  89.     public int getSelectedIndex(){
  90.         if(isEnabled) return rawList.getSelectedIndex();
  91.         else return -1;
  92.     }
  93.    
  94.     public String getEmptyLabel() {
  95.         return emptyLabel;
  96.     }
  97.  
  98.  
  99.     public void setEmptyLabel(String emptyLabel) {
  100.         this.emptyLabel = emptyLabel;
  101.     }
  102.    
  103.     public String[] getHeaders() {
  104.         return headers;
  105.     }
  106.  
  107.     /**
  108.      * Sets the headers
  109.      * @param headers String of headers (Use SEPARATOR to concatenate headers to each other)
  110.      * @param background - Must be not null!
  111.      */
  112.     public void setHeaders(String headers, Drawable background) {
  113.         if(background==null) throw new IllegalArgumentException("Background must be not null!");
  114.         this.headers = headers.split(SEPARATOR_TEMPLATE);      
  115.         headersBackground = background;
  116.     }
  117.  
  118.     public Color getHeadersColor() {
  119.         return headersColor;
  120.     }
  121.  
  122.     public void setHeadersColor(Color headersColor) {
  123.         this.headersColor = headersColor;
  124.     }
  125.                        
  126.     /******************** RAW LIST ************************/
  127.     public class MyRawList extends Widget{
  128.        
  129.         private MyLazyImageList2 myLazyImageList;
  130.         private ListStyle style;
  131.         private MyLazyImageListItem[] items;
  132.         private int selectedIndex; 
  133.         private float prefWidth, prefHeight;
  134.         private float itemHeight;
  135.         private float textOffsetX, textOffsetY;
  136.         private float coefH;
  137.         private float coefW;
  138.        
  139.         private volatile Map<String, Pixmap> neccessaryCache;
  140.         private Map<String, Texture> cache;
  141.        
  142.         private volatile List<String> beingDownloaded = new ArrayList<String>();
  143.         private volatile List<String> downloaded = new ArrayList<String>();
  144.         private List<String> tempDownloaded = new ArrayList<String>();
  145.        
  146.         private List<String[]> elements = new ArrayList<String[]>();
  147.        
  148.         private int imageWidth = 35, imageHeight = 26;  
  149.        
  150.        
  151.         public MyRawList (MyLazyImageListItem[] items, ListStyle style, MyLazyImageList2 myLazyImageList) {
  152.             coefH = (float)Gdx.graphics.getHeight()/320;
  153.             coefW = (float)Gdx.graphics.getWidth()/480;
  154.             setStyle(style);
  155.             setItems(items);
  156.             setWidth(getPrefWidth());
  157.             setHeight(getPrefHeight());    
  158.             this.myLazyImageList=myLazyImageList;
  159.            
  160.             neccessaryCache = new HashMap<String, Pixmap>();  
  161.             cache = new HashMap<String, Texture>();
  162.            
  163.             addListener(new InputListener() {
  164.                 public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
  165.                     if(!isEnabled) return false;
  166.                     if (pointer == 0 && button != 0) return false;
  167.                     MyRawList.this.touchDown(y);
  168.                     return true;
  169.                 }
  170.             });        
  171.         }
  172.                
  173.         protected synchronized Map<String, Pixmap> getCache(){
  174.             return neccessaryCache;
  175.         }
  176.                                                            
  177.         protected Texture getTexture(URL url){
  178.            
  179.             String urlStr = url.toString();
  180.            
  181.             if(downloaded.contains(urlStr)&&!beingDownloaded.contains(urlStr)){            
  182.                 if(getCache().containsKey(urlStr)){
  183.                     Pixmap pixmap = getCache().remove(urlStr);
  184.                     cache.put(urlStr, new Texture(pixmap));
  185.                 }
  186.                 if(cache.get(urlStr)!=null) return cache.get(urlStr);
  187.             }
  188.                        
  189.             asyncDownloadTextureFromURL(url);          
  190.                        
  191.             return placeholder;
  192.         }
  193.                
  194.         protected void clearPixmapCache(int from, int to) {  
  195.             tempDownloaded.clear();
  196.             for(int i = from; i<=to; i++){
  197.                 if(!tempDownloaded.contains(items[i].url.toString())&&downloaded.contains(items[i].url.toString())){
  198.                     tempDownloaded.add(items[i].url.toString());                   
  199.                 }
  200.             }          
  201.            
  202.             downloaded.removeAll(tempDownloaded);
  203.            
  204.             for(String key : downloaded){
  205.                 if(cache.containsKey(key)){
  206.                     cache.remove(key).dispose();                   
  207.                 }              
  208.             }
  209.            
  210.             downloaded.clear();
  211.             downloaded.addAll(tempDownloaded);
  212.         }  
  213.        
  214.                        
  215.         protected void asyncDownloadTextureFromURL(final URL url) {            
  216.             final String urlStr = url.toString();
  217.             if(beingDownloaded.contains(urlStr)) return;           
  218.             if(threadAmount>=MAX_THREAD_AMOUNT) return;
  219.             threadAmount++;
  220.             new Thread(new Runnable() {            
  221.                 @Override
  222.                 public void run() {                
  223.                     beingDownloaded.add(urlStr);
  224.                    
  225.                     Gdx.app.log("MyLazyImageList", "Start downloading: "+urlStr);
  226.                     Pixmap pixmap = syncDownloadPixmapFromURL(url);
  227.                    
  228.                     if(pixmap==null){
  229.                         beingDownloaded.remove(urlStr);
  230.                         threadAmount--;
  231.                         return;
  232.                     }
  233.                    
  234.                     if(pixmap!=null)
  235.                         getCache().put(urlStr, pixmap);
  236.                    
  237.                     Gdx.app.log("MyLazyImageList", "Stop downloading: "+urlStr);
  238.                    
  239.                     if(!downloaded.contains(urlStr))
  240.                         downloaded.add(urlStr);
  241.                     beingDownloaded.remove(urlStr);                
  242.                     threadAmount--;                
  243.                 }
  244.             }).start();
  245.            
  246.         }  
  247.        
  248.         private Pixmap syncDownloadPixmapFromURL(URL url) {  
  249.                 try {              
  250.                     /*Properties systemProperties = System.getProperties();
  251.                     systemProperties.setProperty("http.proxyHost","proxy");
  252.                     systemProperties.setProperty("http.proxyPort","3128");
  253.                     Authenticator authenticator = new Authenticator() {
  254.  
  255.                         public PasswordAuthentication getPasswordAuthentication() {
  256.                             return (new PasswordAuthentication("nik",
  257.                                     "AresII".toCharArray()));
  258.                         }
  259.                     };
  260.                     Authenticator.setDefault(authenticator);*/
  261.                     HttpURLConnection conn= (HttpURLConnection)url.openConnection();
  262.                     conn.setDoInput(true);
  263.                     conn.connect();
  264.                     int length = conn.getContentLength();  
  265.                     if(length<=0) return null;
  266.                     InputStream is = conn.getInputStream();
  267.                     DataInputStream dis = new DataInputStream(is);
  268.                     byte[] data = new byte[length];
  269.                     dis.readFully(data);
  270.                     Pixmap pixmap = new Pixmap(data, 0, data.length);
  271.                     pixmap = ImagePow2.isPow2(pixmap)?pixmap:ImagePow2.getPow2Pixmap(pixmap);
  272.                     return pixmap;                   
  273.                      
  274.                 } catch (MalformedURLException e) {  
  275.                     e.printStackTrace();  
  276.                 } catch (IOException e) {  
  277.                     e.printStackTrace();  
  278.                 }  
  279.                 return null;
  280.          }      
  281.        
  282.         void touchDown (float y) {
  283.             int oldIndex = selectedIndex;
  284.             selectedIndex = (int)((getHeight() - y) / itemHeight);
  285.             selectedIndex = Math.max(0, selectedIndex);
  286.             selectedIndex = Math.min(items.length - 1, selectedIndex);
  287.             ChangeEvent changeEvent = Pools.obtain(ChangeEvent.class);
  288.             if (fire(changeEvent)) selectedIndex = oldIndex;
  289.             Pools.free(changeEvent);
  290.         }
  291.  
  292.         public void setStyle (ListStyle style) {
  293.             if (style == null) throw new IllegalArgumentException("style cannot be null.");
  294.             this.style = style;
  295.             if (items != null)
  296.                 setItems(items);
  297.             else
  298.                 invalidateHierarchy();
  299.         }
  300.  
  301.         /** Returns the list's style. Modifying the returned style may not have an effect until {@link #setStyle(ListStyle)} is called. */
  302.         public ListStyle getStyle () {
  303.             return style;
  304.         }
  305.  
  306.         int startIndex = 0;
  307.         int lastVisibleIndex = 0;
  308.                
  309.         @Override
  310.         public void draw (SpriteBatch batch, float parentAlpha) {
  311.            
  312.             BitmapFont font = style.font;
  313.             Drawable selectedDrawable = style.selection;
  314.             Color fontColorSelected = style.fontColorSelected;
  315.             Color fontColorUnselected = style.fontColorUnselected;
  316.  
  317.             float x = getX();
  318.             float y = getY();
  319.            
  320.             Color color = getColor();
  321.             parentAlpha*=getColor().a;     
  322.             batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
  323.            
  324.             font.setColor(fontColorUnselected.r, fontColorUnselected.g, fontColorUnselected.b, fontColorUnselected.a * parentAlpha);
  325.             float itemY = getHeight();
  326.                        
  327.             //Makes offset for headers
  328.             if(headers!=null && !headers.equals("")){          
  329.                 itemY -= itemHeight/3 + (textOffsetY/3)*coefH - font.getBounds(headers[0]).height/2;               
  330.             }
  331.            
  332.             if(items==null||elements.isEmpty()){
  333.                 float centerX = myLazyImageList.getWidth()/2;
  334.                 float centerY = myLazyImageList.getHeight()/2;
  335.                 font.draw(batch, emptyLabel, centerX - font.getBounds(emptyLabel).width/2,
  336.                         centerY+font.getBounds(emptyLabel).height/2);
  337.                        
  338.                 return;
  339.             }
  340.            
  341.             boolean isSetLastVisibleIndex = true;
  342.             for (int i = 0; i < items.length; i++) {
  343.                 boolean isDrawn = true;
  344.                                
  345.                 if(getHeight()-itemY<myLazyImageList.getScrollY()-itemHeight){
  346.                     startIndex=i;
  347.                     isDrawn=false;
  348.                 }              
  349.                 if(getHeight()-itemY>myLazyImageList.getScrollY()+myLazyImageList.getHeight()){                
  350.                     if(isSetLastVisibleIndex) lastVisibleIndex=i;                  
  351.                     isSetLastVisibleIndex = false;
  352.                     isDrawn=false;
  353.                 }
  354.                
  355.                 if(isDrawn){                       
  356.                     if (selectedIndex == i && selectedIndex!=-1) {
  357.                         //if(isEnabled){
  358.                             selectedDrawable.draw(batch, x, y + itemY - itemHeight, getWidth(), itemHeight);
  359.                             font.setColor(fontColorSelected.r, fontColorSelected.g,
  360.                                     fontColorSelected.b, fontColorSelected.a * parentAlpha);
  361.                        
  362.                     }
  363.                     else{
  364.                         //if(isEnabled){
  365.                             font.setColor(fontColorUnselected.r, fontColorUnselected.g, fontColorUnselected.b,
  366.                                     fontColorUnselected.a * parentAlpha);
  367.                        
  368.                     }
  369.                    
  370.                     float equalPartWidth = getWidth()/(elements.get(i).length+1);
  371.                    
  372.                     for(int j=0; j<elements.get(i).length; j++){
  373.                         String shortName = cutName(font, elements.get(i)[j], (int)(equalPartWidth));
  374.                         if(shortName.equals(elements.get(i)[j]))
  375.                             font.draw(batch, elements.get(i)[j]
  376.                                     , x + textOffsetX +equalPartWidth*(j)+(equalPartWidth-font.getBounds(elements.get(i)[j]).width)/2,
  377.                                     y + itemY - textOffsetY*coefH - font.getBounds(items[i].name).height/2);
  378.                         else
  379.                             font.draw(batch, shortName
  380.                                 , x + textOffsetX + equalPartWidth*(j),
  381.                                 y + itemY - textOffsetY*coefH - font.getBounds(items[i].name).height/2);
  382.                     }
  383.                    
  384.                     Texture tempTexture = getTexture(items[i].url);
  385.                     if(tempTexture!=null)
  386.                     batch.draw(tempTexture, x + textOffsetX +equalPartWidth*(elements.get(i).length)+(equalPartWidth-imageWidth)/2,
  387.                             y + itemY-textOffsetY*coefH/2-imageHeight , imageWidth, imageHeight);  
  388.                 }
  389.                                    
  390.                 itemY -= itemHeight;
  391.             }
  392.            
  393.             //Drawing headers          
  394.             if(headers!=null && !headers.equals("")){  
  395.                 float height = font.getBounds(headers[0]).height + 6*coefH;                            
  396.                 headersBackground.draw(batch, 0, myLazyImageList.getHeight()-height, myLazyImageList.getWidth(), height);
  397.                
  398.                 float equalPartWidthForHeader = getWidth()/headers.length;
  399.                 font.setColor(headersColor==null?fontColorSelected:headersColor);
  400.                
  401.                 for(int k=0; k<headers.length; k++){
  402.                     font.draw(batch, headers[k], x+ textOffsetX + equalPartWidthForHeader*(k)
  403.                             + (equalPartWidthForHeader-font.getBounds(headers[k]).width)/2,
  404.                             myLazyImageList.getHeight()-3*coefH);
  405.                 }              
  406.             }
  407.            
  408.             clearPixmapCache(startIndex, lastVisibleIndex);
  409.         }
  410.        
  411.         private String cutName(BitmapFont font, String name, int width){
  412.             if(font.getBounds(name).width<=width) return name;
  413.             String tempName = name;
  414.             while(true){
  415.                 if(font.getBounds(tempName+"...").width>width){
  416.                     if(tempName.length()<3) break;
  417.                     tempName=tempName.substring(0, tempName.length()-2);               
  418.                 }
  419.                 else break;
  420.             }
  421.             return tempName+"...";
  422.         }
  423.  
  424.         /** @return The index of the currently selected item. The top item has an index of 0. */
  425.         public int getSelectedIndex () {
  426.             return selectedIndex;
  427.         }
  428.  
  429.         public void setSelectedIndex (int index) {
  430.             if(index==-1) { selectedIndex = -1; return; }
  431.             if(items==null) throw new GdxRuntimeException("There are no any items!");
  432.             if (index < -1 || index >= items.length)               
  433.                 throw new GdxRuntimeException("index must be >= -1 and < " + items.length + ": " + index);
  434.             selectedIndex = index;
  435.         }
  436.  
  437.         /** @return The text of the currently selected item or null if the list is empty. */
  438.         public MyLazyImageListItem getSelection () {
  439.             if(items==null) return null;
  440.             if (items.length == 0) return null;
  441.             return items[selectedIndex];
  442.         }
  443.  
  444.         /** @return The index of the item that was selected, or -1. */
  445.         public int setSelection (String item) {
  446.             selectedIndex = -1;
  447.             if(items==null) return -1;
  448.             for (int i = 0, n = items.length; i < n; i++) {
  449.                 if (items[i].equals(item)) {
  450.                     selectedIndex = i;
  451.                     break;
  452.                 }
  453.             }
  454.             return selectedIndex;
  455.         }
  456.                
  457.         public void setItems (MyLazyImageListItem[] objects) {
  458.             elements.clear();
  459.             if(objects == null){
  460.                 items = null;              
  461.                 return;
  462.             }
  463.             //if (objects == null) throw new IllegalArgumentException("items cannot be null.");
  464.  
  465.             if (!(objects instanceof MyLazyImageListItem[])) {         
  466.                 throw new IllegalArgumentException("Items must be instance of MyLazyImageListItem");
  467.             }
  468.                
  469.             items = objects;
  470.             selectedIndex = 0;
  471.  
  472.             final BitmapFont font = style.font;
  473.             final Drawable selectedDrawable = style.selection;
  474.  
  475.             itemHeight = font.getCapHeight() - font.getDescent() * 2;
  476.             itemHeight += selectedDrawable.getTopHeight() + selectedDrawable.getBottomHeight();
  477.             itemHeight*=coefH;
  478.             prefWidth += selectedDrawable.getLeftWidth() + selectedDrawable.getRightWidth();
  479.             textOffsetX = selectedDrawable.getLeftWidth()*coefW;
  480.             textOffsetY = selectedDrawable.getTopHeight() - font.getDescent();
  481.  
  482.             prefWidth = 0;
  483.             for (int i = 0; i < items.length; i++) {           
  484.                 TextBounds bounds = font.getBounds(items[i].name);
  485.                 prefWidth = Math.max(bounds.width, prefWidth);
  486.                
  487.                         //cutName(font, items[i].showName, (int)(getWidth()-imageWidth-textOffsetX*2-5));
  488.             }
  489.             prefHeight = items.length * itemHeight;        
  490.             imageWidth*=coefW;
  491.             imageHeight*=coefH;                        
  492.            
  493.             for(int i=0; i<objects.length; i++){
  494.                 String[] names = objects[i].name.split(SEPARATOR_TEMPLATE);
  495.                 elements.add(names);
  496.             }
  497.            
  498.             invalidateHierarchy();         
  499.         }
  500.        
  501.        
  502.                                        
  503.         public MyLazyImageListItem[] getItems () {
  504.             return items;
  505.         }
  506.  
  507.         public float getPrefWidth () {
  508.             return prefWidth;
  509.         }
  510.  
  511.         public float getPrefHeight () {
  512.             return prefHeight;
  513.         }
  514.                
  515.     }  
  516.    
  517.     /************************ LIST ITEM ************************/
  518.     public static class MyLazyImageListItem{
  519.         public String name;    
  520.         public URL url;    
  521.        
  522.         public MyLazyImageListItem(String name, URL url){          
  523.             this.name = name;          
  524.             this.url=url;          
  525.         }
  526.                        
  527.         /**
  528.          * Forms array of items (size of texts must be equal to size of urls)
  529.          * @param texts If you want to have several columns, you should split them by SEPARATOR
  530.          * @param urls URLs of the images which has to be downloaded
  531.          * @return
  532.          */
  533.         public static MyLazyImageListItem[] formItems(String[] texts, URL[] urls) {
  534.             if(texts.length!=urls.length) return null;
  535.                 //throw new Exception("Amount of text variables must be equals to amount of textures variable!");
  536.             MyLazyImageListItem[] listItems = new MyLazyImageListItem[texts.length];           
  537.             for (int i=0; i<texts.length; i++) {       
  538.                     listItems[i] = new MyLazyImageListItem(texts[i], urls[i]);             
  539.             }
  540.             return listItems;
  541.         }
  542.     }  
  543.    
  544.     public static class ImagePow2 {
  545.        
  546.         static int pow2[] = {2,4,8,16,32,64,128,256,512,1024,2048,4096,8192};      
  547.         public static boolean isPow2(Pixmap pixmap){
  548.             boolean isWidthPow2 = false, isHeightPow2 = false;
  549.             for(int i=0; i<pow2.length; i++){
  550.                 if(pow2[i]==pixmap.getWidth()) isWidthPow2=true;
  551.                 if(pow2[i]==pixmap.getHeight()) isHeightPow2=true;
  552.             }
  553.             return isWidthPow2&&isHeightPow2;
  554.         }
  555.         private static int getPow2(int value){
  556.             int diff = value;
  557.             int tmp = value;
  558.             int minVal = value;
  559.             for(int i=0; i<pow2.length; i++){
  560.                 diff = Math.abs(value - pow2[i]);
  561.                 if(tmp>diff){
  562.                     tmp=diff;
  563.                     minVal = pow2[i];
  564.                 }
  565.             }
  566.             return minVal;
  567.         }
  568.        
  569.         public static Pixmap getPow2Pixmap(Pixmap pixmap){
  570.             int width = getPow2(pixmap.getWidth());
  571.             int height = getPow2(pixmap.getHeight());
  572.             Pixmap updatedPixmap = new Pixmap(width, height, pixmap.getFormat());            
  573.             updatedPixmap.drawPixmap(pixmap, 0, 0, pixmap.getWidth(), pixmap.getHeight(),
  574.                     0, 0, width, height);
  575.             return updatedPixmap;
  576.         }              
  577.     }
  578. }
  579.  
  580. /**TO USE**/
  581. /*
  582. MyLazyImageList2 myLazyListTop100 = new MyLazyImageList2(null, scrollPaneStyle, listStyle,
  583.                 new Texture(Gdx.files.internal("skins/unknown_flag.png")));        
  584.         myLazyListTop100.setEnabled(false);
  585.         String splitter = MyLazyImageList2.SEPARATOR;
  586.         myLazyListTop100.setHeaders("#"+splitter+"Nickname"+splitter+"Location"+splitter+"Score"+splitter+"flag",
  587.                 dialogStyle.stageBackground);
  588.         myLazyListTop100.setHeadersColor(new Color(0, 1, 1, 1));  
  589.         MyLazyImageListItem[] items = MyLazyImageListItem.formItems(names, urls);
  590.                 myLazyListTop100.setItems(items);
  591.                 myLazyListTop100.setSelectedIndex(player_position-1);      
  592.         stage.addActor(myLazyListTop100);
  593. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement