Esempio n. 1
0
        public JArray AquireMirroredGreenJsonData()
        {
            JArray  jsonData = new JArray();
            JObject tmp;

            float w = Form1.frameWidth * Form1.inc;
            float h = Form1.frameHeight * Form1.inc;

            int realX, realY;

            if (GreenHitBoxes.Any())
            {
                foreach (Rectangle rect in GreenHitBoxes)
                {
                    realX = rect.X - Form1.posX;
                    realY = rect.Y - Form1.posY;

                    realX = (int)w - realX - rect.Width;

                    tmp = new JObject();
                    tmp.Add(new JProperty("X", (float)realX / w));
                    tmp.Add(new JProperty("Y", (float)realY / h));
                    tmp.Add(new JProperty("W", (float)rect.Width / w));
                    tmp.Add(new JProperty("H", (float)rect.Height / h));
                    jsonData.Add(tmp);
                }
            }

            return(jsonData);
        }
Esempio n. 2
0
        public JArray AquireGreenJsonData()
        {
            JArray  jsonData = new JArray();
            JObject tmp;

            float w = Form1.frameWidth * Form1.inc;
            float h = Form1.frameHeight * Form1.inc;

            if (GreenHitBoxes.Any())
            {
                foreach (Rectangle rect in GreenHitBoxes)
                {
                    tmp = new JObject();
                    tmp.Add(new JProperty("X", (float)(rect.X - Form1.posX) / w));
                    tmp.Add(new JProperty("Y", (float)(rect.Y - Form1.posY) / h));
                    tmp.Add(new JProperty("W", (float)rect.Width / w));
                    tmp.Add(new JProperty("H", (float)rect.Height / h));
                    jsonData.Add(tmp);
                }
            }

            return(jsonData);
        }