コード例 #1
0
        public AGSTextComponent(IRenderPipeline pipeline, IBoundingBoxBuilder boundingBoxBuilder,
                                IGLTextureRenderer textureRenderer, BitmapPool bitmapPool,
                                AGSBoundingBoxes labelBoundingBoxes, AGSBoundingBoxes textBoundingBoxes,
                                IGLUtils glUtils, IGraphicsBackend graphics, IFontFactory fonts,
                                IRuntimeSettings settings, IRenderMessagePump messagePump, IGameState state, IGameEvents events)
        {
            _pipeline = pipeline;
            _afterCropTextBoundingBoxes = new AGSBoundingBoxes();
            _state                       = state;
            _events                      = events;
            Width                        = 1f;
            Height                       = 1f;
            _matricesPool                = new GLMatrices[3];
            _messagePump                 = messagePump;
            OnLabelSizeChanged           = new AGSEvent();
            _graphics                    = graphics;
            _fonts                       = fonts;
            _bitmapPool                  = bitmapPool;
            _labelBoundingBoxes          = labelBoundingBoxes;
            _textBoundingBoxes           = textBoundingBoxes;
            _boundingBoxBuilder          = boundingBoxBuilder;
            _virtualResolution           = settings.VirtualResolution;
            _settings                    = settings;
            _labelBoundingBoxFakeBuilder = new BoundingBoxesEmptyBuilder();

            _instructionPool = new ObjectPool <Instruction>(pool => new Instruction(pool, glUtils, textureRenderer, _glTextHitTest), 0);

            TextVisible = true;

            subscribeTextConfigChanges();
            PropertyChanged           += onPropertyChanged;
            _shouldUpdateBoundingBoxes = true;
        }
コード例 #2
0
 public RoomTransitionDissolve(IGLUtils glUtils, float timeInSeconds = 1f, Func <float, float> easing = null, IGame game = null)
 {
     _timeInSeconds = timeInSeconds;
     _easing        = easing ?? Ease.Linear;
     _game          = game ?? AGSGame.Game;
     _screenVectors = new QuadVectors(_game, glUtils);
 }
コード例 #3
0
 public ArrowIcon(IGLUtils glUtils, IRuntimeSettings settings, ArrowDirection direction = default,
                  Color?color = null)
 {
     _glUtils   = glUtils;
     _settings  = settings;
     ArrowColor = (color ?? (Color?)Colors.White).Value.ToGLColor();
     _direction = direction;
 }
コード例 #4
0
 public AGSColoredBorder(IGLUtils glUtils, float lineWidth, FourCorners <Color> color, FourCorners <bool> hasRoundCorner)
 {
     _glUtils       = glUtils;
     LineWidth      = lineWidth;
     Color          = color;
     HasRoundCorner = hasRoundCorner;
     _roundCorner   = new GLVertex[ROUND_CORNER_SAMPLE_SIZE + 1];
 }
コード例 #5
0
ファイル: QuadVectors.cs プロジェクト: ebrucucen/MonoAGS
 public QuadVectors(IGame game, IGLUtils glUtils)
 {
     _glUtils    = glUtils;
     TopLeft     = new Vector3();
     BottomLeft  = new Vector3(0f, game.Settings.VirtualResolution.Height, 0f);
     TopRight    = new Vector3(game.Settings.VirtualResolution.Width, 0f, 0f);
     BottomRight = new Vector3(game.Settings.VirtualResolution.Width, game.Settings.VirtualResolution.Height, 0f);
 }
コード例 #6
0
ファイル: QuadVectors.cs プロジェクト: ebrucucen/MonoAGS
 public QuadVectors(float x, float y, float width, float height, IGLUtils glUtils)
 {
     _glUtils    = glUtils;
     TopLeft     = new Vector3(x, y, 0f);
     BottomLeft  = new Vector3(x, y + height, 0f);
     TopRight    = new Vector3(x + width, y, 0f);
     BottomRight = new Vector3(x + width, y + height, 0f);
 }
コード例 #7
0
ファイル: QuadVectors.cs プロジェクト: tzachshabtay/MonoAGS
        public QuadVectors(IGame game, IGLUtils glUtils)
		{
            _glUtils = glUtils;
			TopLeft = new Vector3 ();
			BottomLeft = new Vector3 (0f, game.Settings.VirtualResolution.Height, 0f);
			TopRight = new Vector3 (game.Settings.VirtualResolution.Width, 0f, 0f);
			BottomRight = new Vector3 (game.Settings.VirtualResolution.Width, game.Settings.VirtualResolution.Height, 0f);
		}
コード例 #8
0
ファイル: QuadVectors.cs プロジェクト: tzachshabtay/MonoAGS
        public QuadVectors(float x, float y, float width, float height, IGLUtils glUtils)
		{
            _glUtils = glUtils;
			TopLeft = new Vector3 (x, y, 0f);
			BottomLeft = new Vector3 (x, y + height, 0f);
			TopRight = new Vector3 (x + width, y, 0f);
			BottomRight = new Vector3 (x + width, y + height, 0f);
		}
コード例 #9
0
		public GLLineRenderer (IGLUtils glUtils, float x1, float y1, float x2, float y2)
		{
            _glUtils = glUtils;
			X1 = x1;
			X2 = x2;
			Y1 = y1;
			Y2 = y2;
		}
コード例 #10
0
		public RoomTransitionCrossFade(IGLUtils glUtils, float timeInSeconds = 1f, Func<float, float> easingFadeOut = null, 
			IGame game = null)
		{
			game = game ?? AGSGame.Game;
			_timeInSeconds = timeInSeconds / 2f;
			_easingFadeOut = easingFadeOut ?? Ease.Linear;
            _screenVectors = new QuadVectors (game, glUtils);
		}
コード例 #11
0
        public RoomTransitionDissolve(IGLUtils glUtils, IGraphicsBackend graphics, float timeInSeconds = 1f, Func<float, float> easing = null, IGame game = null)
		{
            _graphics = graphics;
			_timeInSeconds = timeInSeconds;
			_easing = easing ?? Ease.Linear;
			game = game ?? AGSGame.Game;
            _screenVectors = new QuadVectors (game, glUtils);
		}
コード例 #12
0
 public RoomTransitionCrossFade(IGLUtils glUtils, float timeInSeconds = 1f, Func <float, float> easingFadeOut = null,
                                IGame game = null)
 {
     game           = game ?? AGSGame.Game;
     _timeInSeconds = timeInSeconds / 2f;
     _easingFadeOut = easingFadeOut ?? Ease.Linear;
     _screenVectors = new QuadVectors(game, glUtils);
 }
コード例 #13
0
ファイル: GLLineRenderer.cs プロジェクト: saizant/MonoAGS
 public GLLineRenderer(IGLUtils glUtils, float x1, float y1, float x2, float y2)
 {
     _glUtils = glUtils;
     X1       = x1;
     X2       = x2;
     Y1       = y1;
     Y2       = y2;
 }
コード例 #14
0
		public AGSColoredBorder(IGLUtils glUtils, float lineWidth, FourCorners<Color> color, FourCorners<bool> hasRoundCorner)
		{
            _glUtils = glUtils;
			LineWidth = lineWidth;
			Color = color;
			HasRoundCorner = hasRoundCorner;
			_roundCorner = new GLVertex[ROUND_CORNER_SAMPLE_SIZE + 1];
		}
コード例 #15
0
 public QuadVectors(float x, float y, float width, float height, IGLUtils glUtils)
 {
     _glUtils    = glUtils;
     TopLeft     = new Vector3(x, y, 0f);
     BottomLeft  = new Vector3(x, y + height, 0f);
     TopRight    = new Vector3(x + width, y, 0f);
     BottomRight = new Vector3(x + width, y + height, 0f);
     _box        = new AGSBoundingBox(BottomLeft, BottomRight, TopLeft, TopRight);
 }
コード例 #16
0
ファイル: XIcon.cs プロジェクト: jeancallisti/MonoAGS
 public XIcon(IGLUtils glUtils, IRuntimeSettings settings, float lineWidth, float padding, Color?color)
 {
     _glUtils   = glUtils;
     _settings  = settings;
     color      = color ?? Colors.Red;
     _color     = color.Value.ToGLColor();
     _lineWidth = lineWidth;
     _padding   = padding;
 }
コード例 #17
0
 public AGSSerializationContext(IGameFactory factory, IDictionary <string, ITexture> textures,
                                Resolver resolver, IGLUtils glUtils)
 {
     Factory        = factory;
     GLUtils        = glUtils;
     Textures       = textures;
     _contracts     = new ContractsFactory();
     Resolver       = resolver;
     _rewireActions = new List <Action <IGameState> > ();
 }
コード例 #18
0
 public GLImageRenderer(ITextureCache textures, ITextureFactory textureFactory,
                        IGLColorBuilder colorBuilder, IGLTextureRenderer renderer, IGLUtils glUtils)
 {
     _textures       = textures;
     _getTextureFunc = textureFactory.CreateTexture;  //Creating a delegate in advance to avoid memory allocations on critical path
     _colorBuilder   = colorBuilder;
     _renderer       = renderer;
     _glUtils        = glUtils;
     _colorAdjusters = new IHasImage[2];
 }
コード例 #19
0
        public GLGraphicsFactory (Dictionary<string, ITexture> textures, IContainer resolver, IGLUtils glUtils, IGraphicsBackend graphics)
		{
			this._textures = textures;
			this._resolver = resolver;
			this._resources = resolver.Resolve<IResourceLoader>();
			this._bitmapLoader = Hooks.BitmapLoader;
            this._spriteSheetLoader = new SpriteSheetLoader (_resources, _bitmapLoader, addAnimationFrame, loadImage, graphics);
            
            AGSGameSettings.CurrentSkin = new AGSBlueSkin(this, glUtils).CreateSkin();
		}
コード例 #20
0
        public FolderIcon(IGLUtils glUtils, IRuntimeSettings settings, Color?color = null, Color?foldColor = null,
                          Color?selectedColor = null, Color?selectedFoldColor = null)
        {
            _glUtils  = glUtils;
            _settings = settings;

            _color             = (color ?? (Color?)Colors.Gold).Value.ToGLColor();
            _foldColor         = (foldColor ?? (Color?)Colors.DarkGoldenrod).Value.ToGLColor();
            _selectedColor     = (selectedColor ?? (Color?)Colors.DeepSkyBlue).Value.ToGLColor();
            _selectedFoldColor = (selectedFoldColor ?? (Color?)Colors.Blue).Value.ToGLColor();
        }
コード例 #21
0
 public AGSRendererLoop(IGameSettings settings, IGameState state,
                        IGLUtils glUtils, IWindowInfo window, IAGSRenderPipeline pipeline,
                        IMatrixUpdater matrixUpdater)
 {
     _pipeline      = pipeline;
     _glUtils       = glUtils;
     _window        = window;
     _settings      = settings;
     _gameState     = state;
     _matrixUpdater = matrixUpdater;
 }
コード例 #22
0
ファイル: FileIcon.cs プロジェクト: saizant/MonoAGS
        public FileIcon(IGLUtils glUtils, IRuntimeSettings settings, Color?color = null, Color?foldColor = null,
                        Color?selecedColor = null, Color?selectedFoldColor = null)
        {
            _glUtils  = glUtils;
            _settings = settings;

            _color             = (color ?? (Color?)Colors.OldLace).Value.ToGLColor();
            _foldColor         = (foldColor ?? (Color?)Colors.Gray).Value.ToGLColor();
            _selectedColor     = (selecedColor ?? (Color?)Colors.DeepSkyBlue).Value.ToGLColor();
            _selectedFoldColor = (selectedFoldColor ?? (Color?)Colors.Blue).Value.ToGLColor();
        }
コード例 #23
0
 public AGSRuntimeSettings(IGameSettings settings, IGameWindow gameWindow, IRenderMessagePump messagePump, IGLUtils glUtils)
 {
     _glUtils            = glUtils;
     _gameWindow         = gameWindow;
     _messagePump        = messagePump;
     Title               = settings.Title;
     VirtualResolution   = settings.VirtualResolution;
     Vsync               = settings.Vsync;
     PreserveAspectRatio = settings.PreserveAspectRatio;
     WindowState         = settings.WindowState;
     WindowBorder        = settings.WindowBorder;
 }
コード例 #24
0
 public AGSRuntimeSettings(IGameSettings settings, IGameWindow gameWindow, IMessagePump messagePump, IGLUtils glUtils)
 {
     _glUtils = glUtils;
     _gameWindow = gameWindow;
     _messagePump = messagePump;
     Title = settings.Title;
     VirtualResolution = settings.VirtualResolution;
     Vsync = settings.Vsync;
     PreserveAspectRatio = settings.PreserveAspectRatio;
     WindowState = settings.WindowState;
     WindowBorder = settings.WindowBorder;
 }
コード例 #25
0
ファイル: AGSGame.cs プロジェクト: ebrucucen/MonoAGS
 public AGSGame(IGameState state, IGameEvents gameEvents, IMessagePump messagePump,
                IGraphicsBackend graphics, IGLUtils glUtils)
 {
     _messagePump = messagePump;
     _messagePump.SetSyncContext();
     State            = state;
     Events           = gameEvents;
     _relativeSpeed   = state.Speed;
     _renderEventArgs = new AGSEventArgs();
     _graphics        = graphics;
     _glUtils         = glUtils;
     GLUtils          = _glUtils;
 }
コード例 #26
0
 public AGSGame(IGameState state, IGameEvents gameEvents, IRenderMessagePump renderMessagePump, IUpdateMessagePump updateMessagePump,
                IGraphicsBackend graphics, IGLUtils glUtils)
 {
     _renderMessagePump = renderMessagePump;
     _renderMessagePump.SetSyncContext();
     _updateMessagePump = updateMessagePump;
     State          = state;
     Events         = gameEvents;
     _relativeSpeed = state.Speed;
     _graphics      = graphics;
     _glUtils       = glUtils;
     GLUtils        = _glUtils;
 }
コード例 #27
0
ファイル: GLLabelRenderer.cs プロジェクト: saizant/MonoAGS
#pragma warning restore CS0067

        public GLLabelRenderer(Dictionary <string, ITexture> textures,
                               IBoundingBoxBuilder boundingBoxBuilder, IGLColorBuilder colorBuilder,
                               IGLTextureRenderer textureRenderer, BitmapPool bitmapPool, IGLViewportMatrixFactory viewportMatrix,
                               AGSBoundingBoxes labelBoundingBoxes, AGSBoundingBoxes textBoundingBoxes, IGraphicsFactory graphicsFactory,
                               IGLUtils glUtils, IGraphicsBackend graphics, IBitmapLoader bitmapLoader, IFontLoader fonts,
                               IRuntimeSettings settings, IRenderMessagePump messagePump, IGameState state, IGameEvents events)
        {
            _bindings = new List <IComponentBinding>();
            _afterCropTextBoundingBoxes = new AGSBoundingBoxes();
            _state                       = state;
            _events                      = events;
            Width                        = 1f;
            Height                       = 1f;
            _matricesPool                = new GLMatrices[3];
            _messagePump                 = messagePump;
            OnLabelSizeChanged           = new AGSEvent();
            _glUtils                     = glUtils;
            _graphics                    = graphics;
            _fonts                       = fonts;
            _bitmapPool                  = bitmapPool;
            _viewport                    = viewportMatrix;
            _textureRenderer             = textureRenderer;
            _labelBoundingBoxes          = labelBoundingBoxes;
            _textBoundingBoxes           = textBoundingBoxes;
            _boundingBoxBuilder          = boundingBoxBuilder;
            _virtualResolution           = settings.VirtualResolution;
            _settings                    = settings;
            _labelBoundingBoxFakeBuilder = new BoundingBoxesEmptyBuilder();
            _bgRenderer                  = new GLImageRenderer(textures,
                                                               colorBuilder, _textureRenderer, graphicsFactory, glUtils, bitmapLoader);

            _colorBuilder = colorBuilder;

            TextVisible           = true;
            TextBackgroundVisible = true;

            subscribeTextConfigChanges();
            PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == nameof(TextBackgroundVisible))
                {
                    return;
                }
                onBoundingBoxShouldChange();
                if (e.PropertyName == nameof(Config))
                {
                    subscribeTextConfigChanges();
                }
            };
            _shouldUpdateBoundingBoxes = true;
        }
コード例 #28
0
		public AGSRendererLoop (Resolver resolver, IGame game, IImageRenderer renderer, IInput input, AGSWalkBehindsMap walkBehinds,
			IAGSRoomTransitions roomTransitions, IGLUtils glUtils)
		{
            this._glUtils = glUtils;
			this._resolver = resolver;
			this._walkBehinds = walkBehinds;
            this._game = game;
			this._gameState = game.State;
			this._renderer = renderer;
			this._input = input;
			this._comparer = new RenderOrderSelector ();
			this._roomTransitions = roomTransitions;
			_roomTransitions.Transition = new RoomTransitionInstant ();
		}
コード例 #29
0
 private AGSSelectFileDialog(IGame game, IGLUtils glUtils, string title, FileSelection fileSelection, string startPath = null)
 {
     _glUtils = glUtils;
     _game = game;
     _title = title;
     _fileSelection = fileSelection;
     _startPath = startPath ?? Hooks.FileSystem.GetCurrentDirectory();
     _buttonsTextConfig = new AGSTextConfig(alignment: Alignment.BottomCenter,
         autoFit: AutoFit.TextShouldFitLabel, font: Hooks.FontLoader.LoadFont(null, 10f));
     _filesTextConfig = new AGSTextConfig(alignment: Alignment.BottomCenter,
         autoFit: AutoFit.TextShouldFitLabel, font: Hooks.FontLoader.LoadFont(null, 10f),
         brush: Hooks.BrushLoader.LoadSolidBrush(Colors.Black));
     _tcs = new TaskCompletionSource<bool>(false);
 }
コード例 #30
0
 private AGSSelectFileDialog(IGame game, IGLUtils glUtils, string title, FileSelection fileSelection, string startPath = null)
 {
     _glUtils           = glUtils;
     _game              = game;
     _title             = title;
     _fileSelection     = fileSelection;
     _startPath         = startPath ?? _device.FileSystem.GetCurrentDirectory() ?? "";
     _buttonsTextConfig = new AGSTextConfig(alignment: Alignment.BottomCenter,
                                            autoFit: AutoFit.TextShouldFitLabel, font: game.Factory.Fonts.LoadFont(null, 10f));
     _filesTextConfig = new AGSTextConfig(alignment: Alignment.BottomCenter,
                                          autoFit: AutoFit.TextShouldFitLabel, font: game.Factory.Fonts.LoadFont(null, 10f),
                                          brush: _device.BrushLoader.LoadSolidBrush(Colors.Black));
     _tcs = new TaskCompletionSource <bool>(false);
 }
コード例 #31
0
ファイル: AGSRendererLoop.cs プロジェクト: ebrucucen/MonoAGS
 public AGSRendererLoop(Resolver resolver, IGame game, IImageRenderer renderer, IInput input, AGSWalkBehindsMap walkBehinds,
                        IAGSRoomTransitions roomTransitions, IGLUtils glUtils)
 {
     this._glUtils               = glUtils;
     this._resolver              = resolver;
     this._walkBehinds           = walkBehinds;
     this._game                  = game;
     this._gameState             = game.State;
     this._renderer              = renderer;
     this._input                 = input;
     this._comparer              = new RenderOrderSelector();
     this._roomTransitions       = roomTransitions;
     _roomTransitions.Transition = new RoomTransitionInstant();
 }
コード例 #32
0
 public RoomTransitionBoxOut(IGLUtils glUtils, float timeInSeconds = 1f, Func <float, float> easingBoxOut = null,
                             Func <float, float> easingBoxIn       = null, IGame game = null)
 {
     _glUtils          = glUtils;
     _timeInSeconds    = timeInSeconds / 2f;
     _easingBoxOut     = easingBoxOut ?? Ease.Linear;
     _easingBoxIn      = easingBoxIn ?? Ease.Linear;
     game              = game ?? AGSGame.Game;
     _screenVectors    = new QuadVectors(game, glUtils);
     _screenWidth      = game.Settings.VirtualResolution.Width;
     _screenHeight     = game.Settings.VirtualResolution.Height;
     _screenHalfWidth  = _screenWidth / 2f;
     _screenHalfHeight = _screenHeight / 2f;
 }
コード例 #33
0
		public RoomTransitionBoxOut(IGLUtils glUtils, float timeInSeconds = 1f, Func<float, float> easingBoxOut = null, 
			Func<float, float> easingBoxIn = null, IGame game = null)
		{
            _glUtils = glUtils;
			_timeInSeconds = timeInSeconds / 2f;
			_easingBoxOut = easingBoxOut ?? Ease.Linear;
			_easingBoxIn = easingBoxIn ?? Ease.Linear;
			game = game ?? AGSGame.Game;
            _screenVectors = new QuadVectors (game, glUtils);
			_screenWidth = game.Settings.VirtualResolution.Width;
			_screenHeight = game.Settings.VirtualResolution.Height;
			_screenHalfWidth = _screenWidth / 2f;
			_screenHalfHeight = _screenHeight / 2f;
		}
コード例 #34
0
        public GLGraphicsFactory(ITextureCache textures, Resolver resolver, IGLUtils glUtils,
                                 IGraphicsBackend graphics, IBitmapLoader bitmapLoader, IRenderThread renderThread,
                                 IResourceLoader resources, IIconFactory icons, IBrushLoader brushes, IRenderMessagePump messagePump)
        {
            Icons              = icons;
            Brushes            = brushes;
            _renderThread      = renderThread;
            _textures          = textures;
            _resolver          = resolver;
            _resources         = resources;
            _bitmapLoader      = bitmapLoader;
            _spriteSheetLoader = new SpriteSheetLoader(_resources, _bitmapLoader, addAnimationFrame, loadImage, graphics, messagePump);

            AGSGameSettings.CurrentSkin = new AGSBlueSkin(this, glUtils).CreateSkin();
        }
コード例 #35
0
 public GLImageRenderer(Dictionary <string, ITexture> textures,
                        IGLColorBuilder colorBuilder, IGLTextureRenderer renderer,
                        IGraphicsFactory graphicsFactory, IGLUtils glUtils,
                        IBitmapLoader bitmapLoader)
 {
     _graphicsFactory   = graphicsFactory;
     _createTextureFunc = createNewTexture; //Creating a delegate in advance to avoid memory allocations on critical path
     _textures          = textures;
     _colorBuilder      = colorBuilder;
     _renderer          = renderer;
     _glUtils           = glUtils;
     _bitmapLoader      = bitmapLoader;
     _emptyTexture      = new Lazy <ITexture>(() => initEmptyTexture());
     _colorAdjusters    = new IHasImage[2];
 }
コード例 #36
0
		public RoomTransitionSlide(IGLUtils glUtils, bool slideIn = false, float? x = null, float y = 0f, 
			float timeInSeconds = 1f, Func<float, float> easingX = null,
			Func<float, float> easingY = null, IGame game = null)
		{
            _glUtils = glUtils;
			game = game ?? AGSGame.Game;
			_timeInSeconds = timeInSeconds;
			_slideIn = slideIn;
			_easingX = easingX ?? Ease.QuadIn;
			_easingY = easingY ?? Ease.QuadIn;
			_targetX = x == null ? game.Settings.VirtualResolution.Width : x.Value;
			_targetY = y;
			_width = game.Settings.VirtualResolution.Width;
			_height = game.Settings.VirtualResolution.Height;
            _screenVectors = new QuadVectors (game, glUtils);
		}
コード例 #37
0
 public RoomTransitionSlide(IGLUtils glUtils, bool slideIn = false, float?x                  = null, float y = 0f,
                            float timeInSeconds            = 1f, Func <float, float> easingX = null,
                            Func <float, float> easingY    = null, IGame game                = null)
 {
     _glUtils       = glUtils;
     game           = game ?? AGSGame.Game;
     _timeInSeconds = timeInSeconds;
     _slideIn       = slideIn;
     _easingX       = easingX ?? Ease.QuadIn;
     _easingY       = easingY ?? Ease.QuadIn;
     _targetX       = x == null ? game.Settings.VirtualResolution.Width : x.Value;
     _targetY       = y;
     _width         = game.Settings.VirtualResolution.Width;
     _height        = game.Settings.VirtualResolution.Height;
     _screenVectors = new QuadVectors(game, glUtils);
 }
コード例 #38
0
        public GLImageRenderer (Dictionary<string, ITexture> textures, 
			IGLMatrixBuilder hitTestMatrixBuilder, IGLMatrixBuilder renderMatrixBuilder, IGLBoundingBoxBuilder boundingBoxBuilder,
			IGLColorBuilder colorBuilder, IGLTextureRenderer renderer, IGLBoundingBoxes bgBoxes,
            IGLViewportMatrixFactory layerViewports, IGraphicsFactory graphicsFactory, IGLUtils glUtils)
		{
            _graphicsFactory = graphicsFactory;
			_textures = textures;
			_renderMatrixBuilder = renderMatrixBuilder;
            _hitTestMatrixBuilder = hitTestMatrixBuilder;
			_boundingBoxBuilder = boundingBoxBuilder;
			_colorBuilder = colorBuilder;
			_renderer = renderer;
			_layerViewports = layerViewports;
			BoundingBoxes = bgBoxes;
            _glUtils = glUtils;
            _emptyTexture = new Lazy<ITexture>(() => initEmptyTexture());
		}
コード例 #39
0
        public AGSWalkComponent(IPathFinder pathFinder, IObjectFactory objFactory, IGame game, IGLUtils glUtils)
        {
            _incomingInstructions = new ConcurrentQueue <WalkInstruction>();
            _state      = game.State;
            _cutscene   = _state.Cutscene;
            _events     = game.Events;
            _pathFinder = pathFinder;
            _objFactory = objFactory;
            _glUtils    = glUtils;

            _debugPath = new List <IObject>();
            AdjustWalkSpeedToScaleArea = true;
            MovementLinkedToAnimation  = true;
            WalkStep = new PointF(8f, 8f);

            _events.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute);
        }
コード例 #40
0
 public GLImageRenderer(Dictionary <string, ITexture> textures,
                        IGLBoundingBoxBuilder boundingBoxBuilder,
                        IGLColorBuilder colorBuilder, IGLTextureRenderer renderer, IGLBoundingBoxes bgBoxes,
                        IGLViewportMatrixFactory layerViewports, IGraphicsFactory graphicsFactory, IGLUtils glUtils,
                        IBitmapLoader bitmapLoader)
 {
     _graphicsFactory    = graphicsFactory;
     _textures           = textures;
     _boundingBoxBuilder = boundingBoxBuilder;
     _colorBuilder       = colorBuilder;
     _renderer           = renderer;
     _layerViewports     = layerViewports;
     BoundingBoxes       = bgBoxes;
     _glUtils            = glUtils;
     _bitmapLoader       = bitmapLoader;
     _emptyTexture       = new Lazy <ITexture>(() => initEmptyTexture());
 }
コード例 #41
0
ファイル: AGSWalkComponent.cs プロジェクト: saizant/MonoAGS
        public AGSWalkComponent(IPathFinder pathFinder, IObjectFactory objFactory, IGame game, IGLUtils glUtils)
        {
            _state      = game.State;
            _cutscene   = _state.Cutscene;
            _events     = game.Events;
            _pathFinder = pathFinder;
            _objFactory = objFactory;
            _glUtils    = glUtils;

            _debugPath     = new List <IObject> ();
            _walkCompleted = new TaskCompletionSource <object> ();
            _walkCompleted.SetResult(null);
            AdjustWalkSpeedToScaleArea = true;
            MovementLinkedToAnimation  = true;
            WalkStep = new PointF(8f, 8f);

            _events.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute);
        }
コード例 #42
0
 public AGSRendererLoop(Resolver resolver, IGame game,
                        IAGSRoomTransitions roomTransitions, IGLUtils glUtils, IGameWindow gameWindow,
                        IAGSRenderPipeline pipeline, IDisplayList displayList,
                        IInput input, IMatrixUpdater matrixUpdater)
 {
     _pipeline                   = pipeline;
     _input                      = input;
     _displayList                = displayList;
     _glUtils                    = glUtils;
     _gameWindow                 = gameWindow;
     _resolver                   = resolver;
     _game                       = game;
     _gameState                  = game.State;
     _noAspectRatioSettings      = new AGSGameSettings(game.Settings.Title, game.Settings.VirtualResolution, preserveAspectRatio: false);
     _roomTransitions            = roomTransitions;
     _matrixUpdater              = matrixUpdater;
     _roomTransitions.Transition = new RoomTransitionInstant();
 }
コード例 #43
0
ファイル: AGSGraySkin.cs プロジェクト: tzachshabtay/MonoAGS
 public AGSGraySkin(IGraphicsFactory factory, IGLUtils glUtils)
 {
     _skin = new AGSColoredSkin(factory)
     {
         ButtonIdleBackColor = Colors.DimGray,
         ButtonHoverBackColor = Colors.LightGray,
         ButtonPushedBackColor = Colors.LightYellow,
         ButtonBorderStyle = AGSBorders.SolidColor(glUtils, Colors.Black, 1f),
         TextBoxBackColor = Colors.DimGray,
         TextBoxBorderStyle = AGSBorders.SolidColor(glUtils, Colors.Black, 1f),
         CheckboxCheckedColor = Colors.SlateGray,
         CheckboxNotCheckedColor = Colors.DimGray,
         CheckboxHoverCheckedColor = Colors.LightGray,
         CheckboxHoverNotCheckedColor = Colors.LightGray,
         CheckboxBorderStyle = AGSBorders.SolidColor(glUtils, Colors.Black, 1f),
         DialogBoxColor = Colors.DarkGray,
         DialogBoxBorder = AGSBorders.SolidColor(glUtils, Colors.Black, 2f)
     };
 }
コード例 #44
0
 public AGSGraySkin(IGraphicsFactory factory, IGLUtils glUtils)
 {
     _skin = new AGSColoredSkin(factory)
     {
         ButtonIdleBackColor          = Colors.DimGray,
         ButtonHoverBackColor         = Colors.LightGray,
         ButtonPushedBackColor        = Colors.LightYellow,
         ButtonBorderStyle            = AGSBorders.SolidColor(glUtils, Colors.Black, 1f),
         TextBoxBackColor             = Colors.DimGray,
         TextBoxBorderStyle           = AGSBorders.SolidColor(glUtils, Colors.Black, 1f),
         CheckboxCheckedColor         = Colors.SlateGray,
         CheckboxNotCheckedColor      = Colors.DimGray,
         CheckboxHoverCheckedColor    = Colors.LightGray,
         CheckboxHoverNotCheckedColor = Colors.LightGray,
         CheckboxBorderStyle          = AGSBorders.SolidColor(glUtils, Colors.Black, 1f),
         DialogBoxColor  = Colors.DarkGray,
         DialogBoxBorder = AGSBorders.SolidColor(glUtils, Colors.Black, 2f)
     };
 }
コード例 #45
0
ファイル: AGSBlueSkin.cs プロジェクト: tzachshabtay/MonoAGS
 public AGSBlueSkin(IGraphicsFactory factory, IGLUtils glUtils)
 {
     _skin = new AGSColoredSkin(factory)
     {
         ButtonIdleBackColor = Colors.CornflowerBlue,
         ButtonHoverBackColor = Colors.Blue,
         ButtonPushedBackColor = Colors.DarkSlateBlue,
         ButtonBorderStyle = AGSBorders.SolidColor(glUtils, Colors.DarkBlue, 1f),
         TextBoxBackColor = Colors.CornflowerBlue,                
         TextBoxBorderStyle = AGSBorders.SolidColor(glUtils, Colors.DarkBlue, 1f),
         CheckboxCheckedColor = Colors.DarkSlateBlue,
         CheckboxNotCheckedColor = Colors.CornflowerBlue,
         CheckboxHoverCheckedColor = Colors.Blue,
         CheckboxHoverNotCheckedColor = Colors.Blue,
         CheckboxBorderStyle = AGSBorders.SolidColor(glUtils, Colors.DarkBlue, 1f),
         DialogBoxColor = Colors.DarkSlateBlue,
         DialogBoxBorder = AGSBorders.SolidColor(glUtils, Colors.DarkBlue, 2f)
     };
 }
コード例 #46
0
		public AGSWalkBehavior(IObject obj, IPathFinder pathFinder, IFaceDirectionBehavior faceDirection, 
                               IHasOutfit outfit, IObjectFactory objFactory, IGame game, IGLUtils glUtils)
		{
            _state = game.State;
            _cutscene = _state.Cutscene;
            _events = game.Events;
			_obj = obj;
			_pathFinder = pathFinder;
			_faceDirection = faceDirection;
			_outfit = outfit;
			_objFactory = objFactory;
            _glUtils = glUtils;

			_debugPath = new List<IObject> ();
			_walkCompleted = new TaskCompletionSource<object> ();
			_walkCompleted.SetResult(null);
            AdjustWalkSpeedToScaleArea = true;
            MovementLinkedToAnimation = true;
            WalkStep = new PointF(8f, 8f);

            _events.OnRepeatedlyExecute.Subscribe(onRepeatedlyExecute);
		}
コード例 #47
0
        public AGSSlicedImageBorder(IGLUtils glUtils)
		{
            _glUtils = glUtils;
			_white = Colors.White.ToGLColor();
		}
コード例 #48
0
ファイル: FolderIcon.cs プロジェクト: tzachshabtay/MonoAGS
 public FolderIcon(IGLUtils glUtils)
 {
     _glUtils = glUtils;
 }
コード例 #49
0
ファイル: ArrowIcon.cs プロジェクト: tzachshabtay/MonoAGS
 public ArrowIcon(IGLUtils glUtils)
 {
     _glUtils = glUtils;
     ArrowColor = Colors.White.ToGLColor();
 }
コード例 #50
0
        public GLTextureRenderer(IGLUtils glUtils)
		{
            _glUtils = glUtils;
		}
コード例 #51
0
ファイル: FileIcon.cs プロジェクト: tzachshabtay/MonoAGS
 public FileIcon(IGLUtils glUtils)
 {
     _glUtils = glUtils;
 }
コード例 #52
0
ファイル: AGSBorders.cs プロジェクト: tzachshabtay/MonoAGS
		public static AGSColoredBorder Gradient(IGLUtils glUtils, FourCorners<Color> color, float lineWidth = 10f, bool hasRoundCorners = false)
		{
			return new AGSColoredBorder (glUtils, lineWidth, color, new FourCorners<bool> (hasRoundCorners));
		}
コード例 #53
0
ファイル: AGSBorders.cs プロジェクト: tzachshabtay/MonoAGS
		public static AGSColoredBorder SolidColor(IGLUtils glUtils, Color? color = null, float lineWidth = 10f, bool hasRoundCorners = false)
		{
			return new AGSColoredBorder(glUtils, lineWidth, new FourCorners<Color>(color == null ? Colors.Black : color.Value), 
				new FourCorners<bool>(hasRoundCorners));
		}