Example #1
0
    void Start()
    {
        // NOTE: bail out if monster is null
        if (this.monster == null)
        {
            Debug.LogWarningFormat("monster was null, bailing...");
            return;
        }

        nameText.text = this.monster.Name;
        nameText.gameObject.SetActive(true);

        ImgDisp.loadSpriteToObject(
            monster.image_base,
            ImageBase,
            string.Format(
                "{0}_{1}_b.png",
                monster.type,
                monster.Name
                )
            );

        ImgDisp.loadSpriteToObject(
            monster.image_awakened,
            ImageAwakened,
            string.Format(
                "{0}_{1}_a.png",
                monster.type,
                monster.Name
                )
            );
    }
 void Start()
 {
     for (int i = 0; i < imageURLs.Count; i++)
     {
         ImgDisp img = Instantiate(IMG_PREFAB, Vector3.zero, Quaternion.identity, imgContainer);
         ImgDisp.loadSpriteToObject(imageURLs[i], img);
     }
 }
Example #3
0
    private void PopulateData(Monster monster)
    {
        Transform nameText = Name.Find("Text");

        nameText.GetComponent <Text>().text = monster.Name;

        Transform typeText = Type.Find("Text");

        typeText.GetComponent <Text>().text = monster.type;

        //NOTE: Redo with stars
        Transform starLevel = StarLevel.Find("Text");

        starLevel.GetComponent <Text>().text = string.Format("{0}*'s", monster.star_level);

        ImgDisp.loadSpriteToObject(
            monster.image_base,
            ImageBase,
            string.Format(
                "{0}_{1}_b.png",
                monster.type,
                monster.Name
                )
            );

        ImgDisp.loadSpriteToObject(
            monster.image_awakened,
            ImageAwakened,
            string.Format(
                "{0}_{1}_a.png",
                monster.type,
                monster.Name
                )
            );

        Transform levelText = Level.Find("Value");

        levelText.GetComponent <Text>().text = string.Format("{0}", monster.level);

        Transform baseHPText = BaseHP.Find("Value");

        baseHPText.GetComponent <Text>().text = string.Format("{0}", monster.base_hp);

        Transform baseAttackText = BaseAttack.Find("Value");

        baseAttackText.GetComponent <Text>().text = string.Format("{0}", monster.base_attack);

        Transform baseSpeedText = BaseSpeed.Find("Value");

        baseSpeedText.GetComponent <Text>().text = string.Format("{0}", monster.base_speed);

        Transform baseDefenseText = BaseDefense.Find("Value");

        baseDefenseText.GetComponent <Text>().text = string.Format("{0}", monster.base_defense);

        Transform baseCritRateText = BaseCritRate.Find("Value");

        baseCritRateText.GetComponent <Text>().text = string.Format("{0}", monster.base_crit_rate);

        Transform baseCritDamageText = BaseCritDamage.Find("Value");

        baseCritDamageText.GetComponent <Text>().text = string.Format("{0}", monster.base_crit_damage);

        Transform baseResistanceText = BaseResistance.Find("Value");

        baseResistanceText.GetComponent <Text>().text = string.Format("{0}", monster.base_resistance);

        Transform baseAccuracyText = BaseAccuracy.Find("Value");

        baseAccuracyText.GetComponent <Text>().text = string.Format("{0}", monster.base_accuracy);
    }
Example #4
0
 public Form1()
 {
     Text                         = "RAW Image Viewer";
     ClientSize                   = new Size(360, 256);
     StartPosition                = FormStartPosition.CenterScreen;
     ct_out                       = new ImgDisp();
     ct_out.Bounds                = new Rectangle(0, 0, 256, 256);
     ct_out.Anchor                = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
     ct_out.BackColor             = Color.Black;
     ct_out.BackgroundImageLayout = ImageLayout.Zoom;
     Controls.Add(ct_out);
     nm_w               = new NumericUpDown();
     nm_w.Location      = new Point(ClientSize.Width - 80, 2);
     nm_w.Size          = new Size(64, 24);
     nm_w.Anchor        = AnchorStyles.Top | AnchorStyles.Right;
     nm_w.Minimum       = 1;
     nm_w.Maximum       = 65535;
     nm_w.ValueChanged += nm_ValueChanged;
     Controls.Add(nm_w);
     nm_h               = new NumericUpDown();
     nm_h.Location      = new Point(nm_w.Location.X, nm_w.Bottom + CON_MRG);
     nm_h.Size          = new Size(64, 24);
     nm_h.Anchor        = AnchorStyles.Top | AnchorStyles.Right;
     nm_h.Minimum       = 1;
     nm_h.Maximum       = 65535;
     nm_h.ValueChanged += nm_ValueChanged;
     Controls.Add(nm_h);
     nm_o               = new NumericUpDown();
     nm_o.Location      = new Point(nm_w.Location.X, nm_h.Bottom + CON_MRG);
     nm_o.Size          = new Size(68, 24);
     nm_o.Anchor        = AnchorStyles.Top | AnchorStyles.Right;
     nm_o.Minimum       = 0;
     nm_o.Maximum       = 9999999;
     nm_o.ValueChanged += nm_ValueChanged;
     Controls.Add(nm_o);
     ch_pal                 = new CheckBox();
     ch_pal.Text            = "Palette";
     ch_pal.Location        = new Point(nm_w.Location.X, nm_o.Bottom + CON_MRG);
     ch_pal.Anchor          = AnchorStyles.Top | AnchorStyles.Right;
     ch_pal.CheckedChanged += ch_pal_CheckedChanged;
     Controls.Add(ch_pal);
     ch_mon                 = new CheckBox();
     ch_mon.Text            = "Mono";
     ch_mon.Location        = new Point(nm_w.Location.X, ch_pal.Bottom + CON_MRG);
     ch_mon.Anchor          = AnchorStyles.Top | AnchorStyles.Right;
     ch_mon.CheckedChanged += ch_mon_CheckedChanged;
     Controls.Add(ch_mon);
     ch_rgb                 = new CheckBox();
     ch_rgb.Text            = "RGB";
     ch_rgb.Location        = new Point(nm_w.Location.X, ch_mon.Bottom + CON_MRG);
     ch_rgb.Anchor          = AnchorStyles.Top | AnchorStyles.Right;
     ch_rgb.CheckedChanged += ch_rgb_CheckedChanged;
     Controls.Add(ch_rgb);
     bt_ap          = new Button();
     bt_ap.Text     = "Apply";
     bt_ap.Location = new Point(nm_w.Location.X, ch_rgb.Bottom + CON_MRG);
     bt_ap.Size     = new Size(64, 24);
     bt_ap.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
     bt_ap.Click   += bt_ap_Click;
     Controls.Add(bt_ap);
     bt_br          = new Button();
     bt_br.Text     = "Browse";
     bt_br.Location = new Point(nm_w.Location.X, bt_ap.Bottom + CON_MRG);
     bt_br.Size     = new Size(64, 24);
     bt_br.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
     bt_br.Click   += bt_br_Click;
     Controls.Add(bt_br);
     bt_lp          = new Button();
     bt_lp.Text     = "Palette";
     bt_lp.Location = new Point(nm_w.Location.X, bt_br.Bottom + CON_MRG);
     bt_lp.Size     = new Size(64, 24);
     bt_lp.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
     bt_lp.Click   += bt_lp_Click;
     Controls.Add(bt_lp);
     bt_sv          = new Button();
     bt_sv.Text     = "Save";
     bt_sv.Location = new Point(nm_w.Location.X, bt_lp.Bottom + CON_MRG);
     bt_sv.Size     = new Size(64, 24);
     bt_sv.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
     bt_sv.Click   += bt_sv_Click;
     Controls.Add(bt_sv);
     ofd        = new OpenFileDialog();
     ofd.Filter = "All files|*.*";
     sfd        = new SaveFileDialog();
     sfd.Filter = "Bitmap|*.bmp";
     loaded     = false;
 }