Thread: Easier Sprite Array Loading

Results 1 to 4 of 4
  1. #1 Easier Sprite Array Loading 
    I'm Back

    Stewie's Avatar
    Join Date
    Jul 2008
    Age
    26
    Posts
    7,989
    Thanks given
    1,877
    Thanks received
    1,491
    Rep Power
    5000
    Code:
    	public Sprite[] loadSpriteArray(String name, int count) {
    		Sprite[] array = new Sprite[count];
    		int offset = 0;
    		for (int i = 0; i < count; i++) {
    			Sprite returnSprite = new Sprite(name, i);
    			array[offset++] = returnSprite;
    		}
    		return array;
    	}


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Client God

    Join Date
    Aug 2009
    Posts
    3,130
    Thanks given
    3
    Thanks received
    614
    Rep Power
    896
    Ummm, what?
    Reply With Quote  
     

  3. #3  
    I'm Back

    Stewie's Avatar
    Join Date
    Jul 2008
    Age
    26
    Posts
    7,989
    Thanks given
    1,877
    Thanks received
    1,491
    Rep Power
    5000
    This is what they do in newer engine clients when loading sprite arrays. I merely made it for 317.

    Usage:
    mySpriteArray = loadSpriteArray(*SPRITENAMEHERE*,SPRITECOUNTHERE);


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #4  
    Registered Member
    Rupps's Avatar
    Join Date
    Oct 2008
    Age
    25
    Posts
    905
    Thanks given
    317
    Thanks received
    24
    Rep Power
    194
    Thanks a bunch Stewie, this will definitely come in handy
    Current Project: [Only registered and activated users can see links. ]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •