Labels

Learn the powerful enterprise adaptable database:

Getting Started With ADABAS & Natural

Thursday, December 1, 2016

105 Construct2 Create Card Label From c2array


.
105 Construct2 Create Card Label From c2array

1) Download Startup File.

Download CardLabelDictionary.capx and rename the project as CardLabelArray.

2) Create c2array file.

Create a json text file “dataset2.json” containing the sample data below. Import into Files folder.
{"c2array":true,"size":[5,2,1],"data":[
[["0"],["A"]],
[["1"],["B"]],
[["2"],["C"]],
[["3"],["D"]],
[["4"],["E"]]
]}

3) Insert Array Object.

Name=ArrayCards.

4) Set new Data File Name in AJAX Project File Request.

File Name= dataset2.json

5) Load New JSON Data Into Array Object during AJAX On Complete Event.


6) Reassign Variable Values

7) Replace DictionaryCards with ArrayCards in all value assignments.

SpriteCardHotSpot.SID.Value, SpriteCardPiece.SID.Value = ArrayCards.At(loopindex,0,0)

8)  Apply Index Shuffling.

SpriteCardPiece.SID.Value= ArrayCards.At(int(DictionaryShuffle.Get(str(loopindex))),0,0)
TextCardLabel.Text= ArrayCards.At(int(DictionaryShuffle.Get(str(loopindex))),1,0)
OUTCOME.

DOWNLOAD:


.

No comments:

Post a Comment