/**
         * Commit archive.
         */
        public void Commit(string description, long playedTime, long progress, string ImagePath, String imageType)
        {
            AndroidBitmap testBitmap = new AndroidBitmap(AndroidBitmapFactory.DecodeFile(ImagePath));
            //3- Write the archive metadata(such as the archive description, progress, and cover image) to the ArchiveSummaryUpdate object.
            ArchiveSummaryUpdate archiveSummaryUpdate = new ArchiveSummaryUpdate.Builder().SetActiveTime(playedTime)
                                                        .SetCurrentProgress(progress)
                                                        .SetDescInfo(description)
                                                        .SetThumbnail(testBitmap)
                                                        .SetThumbnailMimeType(imageType)
                                                        .Build();
            //2- Call the ArchiveDetails.set method to write the current archive file of the player to the ArchiveDetails object.
            ArchiveDetails archiveContents = new ArchiveDetails.Builder().Build();

            byte[] arrayOfByte1 = Encoding.UTF8.GetBytes(progress + description + playedTime);
            archiveContents.Set(arrayOfByte1);
            //4- Call the ArchivesClient.addArchive method to submit the archive.
            bool isSupportCache = true;
            ITask <ArchiveSummary> addArchiveTask = Games.GetArchiveClient().AddArchive(archiveContents, archiveSummaryUpdate, isSupportCache);
            ArchiveSummary         archiveSummary = null;

            addArchiveTask.AddOnSuccessListener((result) =>
            {
                archiveSummary = result;
                if (archiveSummary != null)
                {
                    Debug.Log("[HMSP:] AddArchive archiveSummary " + archiveSummary.FileName);
                }
            }).AddOnFailureListener((exception) =>
            {
                Debug.Log("[HMS:] AddArchive fail: " + exception.ErrorCode + " :: " + exception.WrappedExceptionMessage + " ::  " + exception.WrappedCauseMessage);
            });
            return;
        }
예제 #2
0
        public void Blit(
            object otherBmpObj,
            int targetX,
            int targetY,
            int sourceX,
            int sourceY,
            int width,
            int height)
        {
            AndroidBitmap otherBmp = (AndroidBitmap)otherBmpObj;

            this.GetCanvas().DrawBitmap(otherBmp.bmp, targetX, targetY, null);
        }
예제 #3
0
 public static bool LoadSync(string filename, object[] nativeImageDataNativeData, List <Value> statusOutCheesy)
 {
     Android.Graphics.Bitmap nativeBmp = ResourceReader.ReadImageFile("ImageSheets/" + filename);
     if (nativeBmp != null)
     {
         AndroidBitmap bmp = new AndroidBitmap(nativeBmp);
         if (statusOutCheesy != null)
         {
             statusOutCheesy.Reverse();
         }
         nativeImageDataNativeData[0] = bmp;
         nativeImageDataNativeData[1] = bmp.Width;
         nativeImageDataNativeData[2] = bmp.Height;
         return(true);
     }
     return(false);
 }
 public Builder SetThumbnail(AndroidBitmap bitmap)
 {
     JavaObject = Call <AndroidJavaObject>("setThumbnail", bitmap);
     return(this);
 }