JavaScript - Splitting a tileset image to be stored in 2D Image() array

前端 未结 2 1125
盖世英雄少女心
盖世英雄少女心 2021-01-18 06:08

Let\'s say I have this image:

\"enter

and I have this 2D array tiles[]

2条回答
  •  野的像风
    2021-01-18 06:50

    ok I did this on my localhost: it should give you a base at least. I think you should be able to use this straight outta the box but you might have to make a few calculation adjustments for it depending on what you want. I just don't think it's neccessary to spend thee time to perfect it to your example:

    You'll obviously have to point the image to your own image.

    
      
        
        
    
      
        
        
      
    
    

提交回复
热议问题