Example #1
0
        public string Set(int index, string value)
        {
            string name = "session_name_" + JavaRuntime.CurrentTimeMillis();

            Set(name, index, value);
            return(name);
        }
Example #2
0
        private void OnSensor(float[] values)
        {
            lock (this)
            {

                long curTime = JavaRuntime.CurrentTimeMillis();

                if (LSystem.SCREEN_LANDSCAPE)
                {
                    currentX = -values[0];
                    currentY = -values[1];
                    currentZ = -values[2];
                }
                else
                {
                    currentX = values[0];
                    currentY = values[1];
                    currentZ = values[2];
                }

                OnOrientation(currentX, currentY, currentZ);

                if ((curTime - lastUpdate) > 30)
                {
                    long diffTime = (curTime - lastUpdate);
                    lastUpdate = curTime;
                    currenForce = MathUtils.Abs(currentX + currentY + currentZ
                            - lastX - lastY - lastZ)
                            / diffTime * 10000;

                    if (currenForce > 500 && eve != null)
                    {
                        eve.OnShakeChanged(currenForce);
                    }
                }

                lastX = currentX;
                lastY = currentY;
                lastZ = currentZ;

                if (eve != null)
                {
                    eve.OnDirection(_direction, currentX, currentY, currentZ);
                }
            }
        }
Example #3
0
 public static LTexture LoadTexture(LTexture texture)
 {
     return(LoadTexture(JavaRuntime.CurrentTimeMillis(), texture));
 }
Example #4
0
 public Sprite(string fileName, int maxFrame, float x, float y, int row,
               int col, long timer)
     : this("Sprite" + JavaRuntime.CurrentTimeMillis(), fileName, maxFrame, x, y,
            row, col, timer)
 {
 }
Example #5
0
 public Sprite(float x, float y)
     : this("Sprite" + JavaRuntime.CurrentTimeMillis(), x, y)
 {
 }
Example #6
0
 public Sprite(LTexture[] images, int maxFrame, float x, float y, long timer)
     : this("Sprite" + JavaRuntime.CurrentTimeMillis(), images, maxFrame, x, y,
            timer)
 {
 }
Example #7
0
 public int PutImage(LImage image)
 {
     return(PutImage(
                JavaRuntime.CurrentTimeMillis() + "|" + Convert.ToString((count + 1)),
                image));
 }
Example #8
0
 public int PutImage(LPixmap image)
 {
     return(PutImage(
                JavaRuntime.CurrentTimeMillis() + "|" + (count + 1),
                image));
 }
Example #9
0
 public Story()
 {
     this.timer     = JavaRuntime.CurrentTimeMillis();
     this.storyName = timer.ToString();
     this.scenes    = new List <Scene>();
 }
Example #10
0
 public void Paint(GLEx g)
 {
     if (background != null)
     {
         if (shakeNumber > 0)
         {
             g.DrawTexture(background,
                           shakeNumber / 2 - LSystem.random.Next(shakeNumber),
                           shakeNumber / 2 - LSystem.random.Next(shakeNumber));
         }
         else
         {
             g.DrawTexture(background, 0, 0);
         }
     }
     lock (charas)
     {
         for (int i = 0; i < charas.Size(); i++)
         {
             AVGChara chara = (AVGChara)charas.Get(i);
             if (chara == null || !chara.isVisible)
             {
                 continue;
             }
             if (style)
             {
                 if (chara.flag != -1)
                 {
                     if (chara.flag == FadeEffect.TYPE_FADE_IN)
                     {
                         chara.currentFrame--;
                         if (chara.currentFrame == 0)
                         {
                             chara.opacity = 0;
                             chara.flag    = -1;
                             chara.Dispose();
                             charas.Remove(chara);
                         }
                     }
                     else
                     {
                         chara.currentFrame++;
                         if (chara.currentFrame == chara.time)
                         {
                             chara.opacity = 0;
                             chara.flag    = -1;
                         }
                     }
                     chara.opacity = (chara.currentFrame / chara.time) * 255;
                     if (chara.opacity > 0)
                     {
                         g.SetAlpha(chara.opacity / 255);
                     }
                 }
             }
             if (chara.isAnimation)
             {
                 AVGAnm animation = chara.anm;
                 if (animation.load)
                 {
                     if (animation.loop && animation.startTime == -1)
                     {
                         animation.Start(0, loop);
                     }
                     Point.Point2i point = animation.GetPos(JavaRuntime
                                                            .CurrentTimeMillis());
                     if (animation.alpha != 1f)
                     {
                         g.SetAlpha(animation.alpha);
                     }
                     g.DrawTexture(animation.texture, chara.x, chara.y,
                                   animation.width, animation.height, point.x,
                                   point.y, point.x + animation.imageWidth,
                                   point.y + animation.imageHeight,
                                   animation.angle, animation.color);
                     if (animation.alpha != 1f)
                     {
                         g.SetAlpha(1f);
                     }
                 }
             }
             else
             {
                 chara.Next();
                 chara.draw(g);
             }
             if (style)
             {
                 if (chara.flag != -1 && chara.opacity > 0)
                 {
                     g.SetAlpha(1f);
                 }
             }
         }
     }
 }