示例#1
0
 // Update is called once per frame
 void Update()
 {
     if (continuouslyResize)
     {
         STools.GetCentredSubImage(image);
     }
 }
示例#2
0
    private void DisplayBlocks(bool toSave)
    {
        //create real objects
        ResetPosition();
        print("creating " + downloadedStrings.Count + " blocks");
        foreach (string stringData in downloadedStrings)
        {
            // create a new block Thumbnail
            GameObject blockObject = STools.AddChild(gridObject, displayPrefab);
            displayedBlocks.Add(blockObject);
            SetFeedReference(blockObject);
            if (imagebufferCount <= 0)
            {
                blockObject.GetComponent <UIData>().AddVariables(stringData, true);
            }
            else
            {
                blockObject.GetComponent <UIData>().AddVariables(stringData, false);
            }
        }
        // Notify of the event!
        OnDownload();

        //save
        if (toSave)
        {
            SaveDataLocal();
        }
        ResetPosition();
    }
示例#3
0
    public void AfterDownload(Texture2D newTex)
    {
        image = newTex;
        //set
        SetTexture(imageObj, image);
        //image url needs to be set first
        DealWithImage(image, data["image"]);

        STools.GetCentredSubImage(rawImage);
    }
示例#4
0
    private void AddFriends(string input)
    {
        //divide into its data components
        string[] friendStringSeparators = { "|friend|" };
        string[] friends = input.Split(friendStringSeparators, System.StringSplitOptions.RemoveEmptyEntries);

        //split into key, value pair and add to data dictionary
        foreach (string friend in friends)
        {
            GameObject newFriend = STools.AddChild(friendGrid, friendPrefab);
            newFriend.GetComponent <Friend>().theData = this;
            newFriend.GetComponent <Friend>().Create(friend);
        }
    }
示例#5
0
    private void SetMainImage()
    {
        print("new blocks downloaded");
        if (displayedBlocks.Count > 0)
        {
            Data_PostV4UI topBlock  = displayedBlocks[0].GetComponent <Data_PostV4UI>();
            Main_Image    mainBlock = mainTexture.GetComponent <Main_Image>();
            mainBlock.data = topBlock.data;
            mainBlock.LoadTextures();

            //remove the top block
            topBlock.DestroyTextures();
            STools.Destroy(displayedBlocks[0]);
            displayedBlocks.RemoveAt(0);
        }
    }
示例#6
0
 private void DisplayBlocks(bool toSave)
 {
     //create real objects
     ResetPosition();
     print("creating " + downloadedStrings.Count + " blocks");
     foreach (string stringData in downloadedStrings)
     {
         // create a new block Thumbnail
         GameObject blockObject = STools.AddChild(gridObject, displayPrefab);
         displayedBlocks.Add(blockObject);
         SetFeedReference(blockObject);
         blockObject.GetComponent <UIData>().AddVariables(stringData);
     }
     //save
     if (toSave)
     {
         SaveDataLocal();
     }
     ResetPosition();
 }
示例#7
0
 // Use this for initialization
 void Start()
 {
     STools.GetCentredSubImage(image);
 }
示例#8
0
 protected void PlayTween(GameObject obj, bool direction)
 {
     STools.NGUIPlayTween(obj, direction);
 }
示例#9
0
 protected void SetLabel(GameObject to, string newText)
 {
     STools.UISetLabel(to, newText);
 }
示例#10
0
    //-------------- HELPER FUNCTIONS --------------------

    protected string GetLabel(GameObject obj)
    {
        return(STools.UIGetLabel(obj));
    }
示例#11
0
 private void AddFeedPadding()
 {
     STools.AddChild(gridObject, paddingObj);
     STools.AddChild(gridObject, paddingObj);
     STools.AddChild(gridObject, paddingObj);
 }