Esempio n. 1
0
    public void RecieveMapImageData(int height, int width, Image.Format format, byte[] imageData)
    {
        Image image = new Image();

        image.CreateFromData(width, height, false, format, Decompress(imageData));
        ImageTexture imageTexture = new ImageTexture();

        imageTexture.CreateFromImage(image, 0);
        Texture = imageTexture;
    }
Esempio n. 2
0
    public void RequestMapImageData(int id, String imagePath)
    {
        Image image  = new Image();
        Error result = image.Load(ClientVariables.MapFolder + imagePath);

        if (result == Error.Ok)
        {
            byte[]       imageData = Compress(image.GetData());
            int          height    = image.GetHeight();
            int          width     = image.GetWidth();
            Image.Format format    = image.GetFormat();
            RpcId(id, nameof(RecieveMapImageData), height, width, format, imageData);
        }
    }
Esempio n. 3
0
    public void RequestImageData(int id, String tokenName, String imagePath)
    {
        Image image  = new Image();
        Error result = image.Load(ClientVariables.TokenFolder + imagePath);

        if (result == Error.Ok)
        {
            byte[]       imageData = Compress(image.GetData());
            int          height    = image.GetHeight();
            int          width     = image.GetWidth();
            Image.Format format    = image.GetFormat();
            int          senderId  = GetTree().NetworkPeer.GetUniqueId();
            RpcId(id, nameof(RecieveImageData), tokenName, senderId, height, width, format, imageData);
        }
    }
Esempio n. 4
0
 public void RecieveImageData(String tokenName, int senderId, int height, int width, Image.Format format, byte[] imageData)
 {
     if (this.Name == tokenName)
     {
         Image image = new Image();
         image.CreateFromData(width, height, false, format, Decompress(imageData));
         SetImageOnSprite(image);
         RpcId(senderId, nameof(RequestPostionAndScale));
     }
 }