private void updateCameraFOV(float percentage, bool tween = false)
        {
            float           num             = 30f;
            float           num2            = 90f;
            AspectRatioType aspectRatioType = PlatformUtils.GetAspectRatioType();

            for (int i = 0; i < ZoomSettings.Length; i++)
            {
                if (aspectRatioType == ZoomSettings[i].Type)
                {
                    num  = ZoomSettings[i].MinFOV;
                    num2 = ZoomSettings[i].MaxFOV;
                    break;
                }
            }
            float num3  = num2 - num;
            float value = num + num3 * percentage;

            value = Mathf.Clamp(value, num, num2);
            if (tween)
            {
                TweenFOV(value);
            }
            else
            {
                myCamera.fieldOfView = value;
            }
        }
Example #2
0
        public Button(NinePatchRegion2D releasedTexture,
                      NinePatchRegion2D hoverTexture,
                      NinePatchRegion2D pressedTexture,
                      Origin origin,
                      float percentX,
                      float pOffsetX,
                      float percentY,
                      float pOffsetY,
                      float percentAspect,
                      float pOffsetAspect,
                      float aspectRatio,
                      AspectRatioType aspectRatioType)
            : base(origin, percentX, pOffsetX, percentY, pOffsetY,
                   percentAspect, pOffsetAspect, aspectRatio, aspectRatioType)
        {
            _releasedTexture = releasedTexture;
            _hoverTexture    = hoverTexture;
            _pressedTexture  = pressedTexture;
            _bounds          = new Vector2(releasedTexture.Width, releasedTexture.Height);

            SubPanel = new Panel(Origin.TopLeft,
                                 0,
                                 0,
                                 0,
                                 0,
                                 1,
                                 0,
                                 1,
                                 (float)0)
            {
                Parent = this
            };
        }
Example #3
0
        public Widget(Origin origin,
                      float percentX,
                      float pOffsetX,
                      float percentY,
                      float pOffsetY,
                      float percentAspect,
                      float pOffsetAspect,
                      float aspectRatio,
                      AspectRatioType aspectRatioType)
        {
            Origin   = origin;
            PercentX = percentX;
            PercentY = percentY;
            POffsetX = pOffsetX;
            POffsetY = pOffsetY;

            PercentWidth  = percentAspect;
            POffsetWidth  = pOffsetAspect;
            PercentHeight = percentAspect;
            POffsetHeight = pOffsetAspect;

            AspectRatio = aspectRatio;

            AspectRatioType = aspectRatioType;
        }
Example #4
0
 public Image(int x, int y, int width, int height, string filename, Colors colorDiffuse, AspectRatioType aspectRatio = AspectRatioType.Stretch)
     : base()
 {
     _aspectRatio  = aspectRatio;
     _colorDiffuse = colorDiffuse;
     //
     Utils.Call(_name + " = xbmcgui.ControlImage(" + x + "," + y + "," + width + "," + height + ",'" + filename + "'," + Colors.ToParam("colorDiffuse", _colorDiffuse) + " aspectRatio = " + (int)_aspectRatio + ")");
 }
 public MainPage()
 {
     this.InitializeComponent();
     currentRatio = AspectRatioType.ratio_4_3;
     selectedBrush = new SolidColorBrush(Windows.UI.Colors.CadetBlue);
     unselectedBrush = new SolidColorBrush(Windows.UI.Colors.DarkGray);
     updateButtons();
     updateRightText();
 }
Example #6
0
 public Panel(Origin origin,
              float percentX,
              float pOffsetX,
              float percentY,
              float pOffsetY,
              float percentAspect,
              float pOffsetAspect,
              float aspectRatio,
              AspectRatioType aspectRatioType)
     : base(origin, percentX, pOffsetX, percentY, pOffsetY,
            percentAspect, pOffsetAspect, aspectRatio, aspectRatioType)
 {
 }
 private static T getAspectRatioSettingsForType <T>(T[] settings, AspectRatioType aspectRatioType) where T : AbstractAspectRatioSpecificSettings
 {
     if (settings != null)
     {
         for (int i = 0; i < settings.Length; i++)
         {
             if (settings[i].SettingsType == aspectRatioType)
             {
                 return(settings[i]);
             }
         }
     }
     return(null);
 }
Example #8
0
 public Label(BitmapFont font,
              Origin origin,
              float percentX,
              float pOffsetX,
              float percentY,
              float pOffsetY,
              float percentAspect,
              float pOffsetAspect,
              AspectRatioType aspectRatioType)
     : base(origin, percentX, pOffsetX, percentY, pOffsetY,
            percentAspect, pOffsetAspect, 0, aspectRatioType)
 {
     _font = font;
 }
Example #9
0
 public NinePatchImage(NinePatchRegion2D ninePatch,
                       Origin origin,
                       float percentX,
                       float pOffsetX,
                       float percentY,
                       float pOffsetY,
                       float percentAspect,
                       float pOffsetAspect,
                       float aspectRatio,
                       AspectRatioType aspectRatioType)
     : base(origin, percentX, pOffsetX, percentY, pOffsetY,
            percentAspect, pOffsetAspect, aspectRatio, aspectRatioType)
 {
     _ninePatch = ninePatch;
 }
Example #10
0
 public Image(Texture2D texture,
              Origin origin,
              float percentX,
              float pOffsetX,
              float percentY,
              float pOffsetY,
              float percentAspect,
              float pOffsetAspect,
              float aspectRatio,
              AspectRatioType aspectRatioType)
     : base(origin, percentX, pOffsetX, percentY, pOffsetY,
            percentAspect, pOffsetAspect, aspectRatio, aspectRatioType)
 {
     _texture = texture;
     _bounds  = new Vector2(_texture.Width, _texture.Height);
 }
 private void onClick(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     if (sender == this.ratio_4_3)
     {
         currentRatio = AspectRatioType.ratio_4_3;
     }
     else if (sender == this.ratio_16_9)
     {
         currentRatio = AspectRatioType.ratio_16_9;
     }
     else if (sender == this.ratio_16_10)
     {
         currentRatio = AspectRatioType.ratio_16_10;
     }
     updateButtons();
     updateRightText();
 }
Example #12
0
 private void mitemAspectRatioStretch_Checked(object sender, RoutedEventArgs e)
 {
     aspectRatio = AspectRatioType.Stretch;
     UpdateAspectRatio();
 }
Example #13
0
 private void mitemAspectRatioOriginal_Checked(object sender, RoutedEventArgs e)
 {
     aspectRatio = AspectRatioType.Original;
     UpdateAspectRatio();
 }
Example #14
0
 private void mitemAspectRatioClip_Checked(object sender, RoutedEventArgs e)
 {
     aspectRatio = AspectRatioType.Clip;
     UpdateAspectRatio();
 }
Example #15
0
        public MainWindow()
        {
            InitializeComponent();
            CreateDXPlayer();

            GlobalEnv.ReadConfiguration();

            sliderTimeline.Value = 0;
            sliderTimeline.IsEnabled = false;

            ShowPlayTime(0.0);

            sliderVolume.Minimum = 0;
            sliderVolume.Maximum = 0xFFFF;
            sliderVolume.Value = GlobalEnv.audioVolume;

            isWindowToVideoSize = GlobalEnv.isWindowToVideoSize == 0 ? false : true;
            IsRecording = null;
            scaleMode = (ScaleMode)GlobalEnv.scale_mode;
            aspectRatio = (AspectRatioType)GlobalEnv.aspect_ratio;

            Left = GlobalEnv.windowLocation.Left;
            Top = GlobalEnv.windowLocation.Top;
            gridMain.Width = GlobalEnv.windowLocation.Width;
            gridMain.Height = GlobalEnv.windowLocation.Height;
            SizeToContent = System.Windows.SizeToContent.WidthAndHeight;

            State = PLAYER_STATE.STATE_STOPPED;

            EventManager.RegisterClassHandler(typeof(Control), Control.PreviewKeyDownEvent, new KeyEventHandler(winMain_KeyDown));
            EventManager.RegisterClassHandler(typeof(Control), Control.PreviewMouseWheelEvent, new MouseWheelEventHandler(winMain_MouseWheel));
        }
Example #16
0
 public Image(int x, int y, int width, int height, string filename, AspectRatioType aspectRatio = AspectRatioType.Stretch)
     : this(x, y, width, height, filename, Colors.None, aspectRatio)
 {
 }
Example #17
0
 public Image(int x, int y, int width, int height, Colors color, Colors colorDiffuse, AspectRatioType aspectRatio = AspectRatioType.Stretch)
     : this(x, y, width, height, color.Texture, colorDiffuse, aspectRatio)
 {
 }
 public static TSettings GetAspectRatioSettingsForType <TSettings, TSettingsComponent, TComponent>(TSettingsComponent component, AspectRatioType aspectRatioType) where TSettings : AbstractAspectRatioSpecificSettings where TSettingsComponent : AspectRatioSpecificSettingsComponent <TComponent, TSettings> where TComponent : Component
 {
     TSettings[] runtimeSettings = component.runtimeSettings;
     return(getAspectRatioSettingsForType(runtimeSettings, aspectRatioType));
 }
Example #19
0
 public SkinnedImage(string filename, AspectRatioType aspectRatio = AspectRatioType.Stretch)
     : this(filename, Colors.None, aspectRatio : aspectRatio)
 {
 }
    public static T FindAspectRatioSettings <T>(T[] settings) where T : AbstractAspectRatioSpecificSettings
    {
        AspectRatioType aspectRatioType = GetAspectRatioType();

        return(getAspectRatioSettingsForType(settings, aspectRatioType));
    }
Example #21
0
 public SkinnedImage(string filename, Colors colorDiffuse, AspectRatioType aspectRatio = AspectRatioType.Stretch)
     : base(-10, -10, 1, 1, filename, colorDiffuse, aspectRatio: aspectRatio)
 {
 }