對於我的項目,我需要能夠放置圖像,然後將座標x,y和圖像名稱「保存」到一個整數。整數然後被放入一個數組中。所以如果數組被調用,它會給出一個圖像名稱和整數座標。如何將座標和圖像保存到整數變量中?
sticker [] placedsticker = new sticker [20];
int slot = 0;
int placedpic;
else if (bluntSoundPlay){ //else if bluntSound is true
EZ.addImage("blunt.png", clickX, clickY); //a blunt will be placed
bluntsound.play(); //and blunt sound will play
placedpic = 0;//each image has a different placed picnumber. ex. 0, 1, 2, 3.
slot ++;//int slot increments every time image is placed so if it is at 1, it will fill in slot 0 of the array. If slot is 2 it will fill in slot 1 of the array.
}
我該如何將所有這些信息保存到定位圖整數?另外,我如何將插槽1放入陣列插槽0?
難道這就是用來保存所有到一個變量/整數? – user5329697
這甚至意味着什麼?將所有內容保存爲整數! – QuakeCore
如果您或其他人可以弄清楚如何將圖像存儲爲32位整數,然後將其恢復,我會付出高昂的代價;)請澄清您的作業要求。 – hotzst