public NuiRenderer( IAssetManager assetManager, IInterlacedBatchingDepthProvider interlacedBatchingDepthProvider) { _uiSmallFont = assetManager.Get <FontAsset>("font.UISmall"); _surfaceEffect = assetManager.Get <UberEffectAsset>("effect.BuiltinSurface"); _interlacedBatchingDepthProvider = interlacedBatchingDepthProvider; }
public DefaultLoadingScreen( I2DRenderUtilities renderUtilities, IAssetManager assetManager) { _renderUtilities = renderUtilities; _assetManager = assetManager; #if PLATFORM_ANDROID _defaultFont = assetManager.Get <FontAsset>("font.HiDpi"); #else _defaultFont = assetManager.Get <FontAsset>("font.Default"); #endif }
public DefaultStandardPointLight( IAssetManager assetManager, Vector3 lightPosition, Color lightColor, float lightRadius, float lightIntensity) { LightPosition = lightPosition; LightColor = lightColor; LightRadius = lightRadius; LightIntensity = lightIntensity; _pointLightEffect = assetManager.Get <EffectAsset>("effect.PointLight"); _pointLightSphereModel = assetManager.Get <ModelAsset>("model.LightSphere"); }
private Button CreatePlayButton(string texture) { var button = new Button { Icon = _assetManager.Get <TextureAsset>(texture) }; button.Click += (sender, e) => { _loadedGame.Playing = true; button.Toggled = true; _workspaceContainer.ActivateWhere(x => x is GameEditorWindow); }; return(button); }
public GCMetricsProfilerVisualiser( IAssetManager assetManager, I2DRenderUtilities renderUtilities) { _renderUtilities = renderUtilities; _defaultFont = assetManager.Get <FontAsset>("font.Default"); #if PLATFORM_WINDOWS || PLATFORM_MACOS || PLATFORM_LINUX // TryGetInstanceName can take up to 1.5 seconds to complete! Queue the work of resolving // these metrics on a background thread so we don't block game startup. ThreadPool.QueueUserWorkItem(o => { string instanceName; if (TryGetInstanceName(Process.GetCurrentProcess(), out instanceName)) { _gen0PerformanceCounter = new PerformanceCounter(".NET CLR Memory", "# Gen 0 Collections", instanceName, true); _gen1PerformanceCounter = new PerformanceCounter(".NET CLR Memory", "# Gen 1 Collections", instanceName, true); _gen2PerformanceCounter = new PerformanceCounter(".NET CLR Memory", "# Gen 2 Collections", instanceName, true); } }); #endif }
public DetectorEntity(WebcamEntity webcamEntity, IAssetManager assetManager, I2DRenderUtilities renderUtilities) { _webcamEntity = webcamEntity; _assetManager = assetManager; _renderUtilities = renderUtilities; _defaultFont = _assetManager.Get <FontAsset>("font.Default"); _colorsToDetect = new List <ColorToDetect> { new ColorToDetect { Color = new Color(1f, 0f, 0f), Name = "Red" }, new ColorToDetect { Color = new Color(0f, 1f, 0f), Name = "Green" }, new ColorToDetect { Color = new Color(0f, 0f, 1f), Name = "Blue" }, new ColorToDetect { Color = new Color(1f, 1f, 0f), Name = "Yellow" } }; _currentIndex = 0; _currentColor = _colorsToDetect[_currentIndex]; GlobalSensitivity = 1 / 10000000f * 25f; _thread = new Thread(ProcessorThread); _thread.IsBackground = true; _thread.Start(); }
public DefaultGraphicsBlit( IAssetManager assetManager, IBackBufferDimensions backBufferDimensions) { _blitEffect = assetManager.Get <UberEffectAsset>("effect.BuiltinSurface"); _backBufferDimensions = backBufferDimensions; }
public ProjectEditorWindow( IAssetManager assetManager, IProjectManager projectManager) { _assetManager = assetManager; _projectManager = projectManager; Title = "Project"; Icon = _assetManager.Get <TextureAsset>("texture.IconFolder"); _projectListView = new ListView(); _projectContentView = new ListView(); var scrollableProjectContainer = new ScrollableContainer(); var scrollableContentContainer = new ScrollableContainer(); scrollableProjectContainer.SetChild(_projectListView); scrollableContentContainer.SetChild(_projectContentView); var horizontalContainer = new HorizontalSpacedContainer(); horizontalContainer.AddChild(scrollableProjectContainer, "350"); horizontalContainer.AddChild(scrollableContentContainer, "*"); var toolbarContainer = new ToolbarContainer(); toolbarContainer.SetChild(horizontalContainer); SetChild(toolbarContainer); }
public DefaultDebugRenderPass(IAssetManager assetManager) { _basicEffect = assetManager.Get <UberEffectAsset>("effect.BuiltinSurface"); Lines = new List <VertexPositionNormalColor>(); Triangles = new List <VertexPositionNormalColor>(); EnabledLayers = new List <IDebugLayer>(); }
public MyGameWorld( I2DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider, IEntityFactory entityFactory) { this.Entities = new List <IEntity>(); _renderUtilities = renderUtilities; _assetManager = assetManagerProvider.GetAssetManager(); _defaultFont = this._assetManager.Get <FontAsset>("font.Default"); // You can also save the entity factory in a field and use it, e.g. in the Update // loop or anywhere else in your game. var entityA = entityFactory.CreateExampleEntity("EntityA"); entityA.X = 100; entityA.Y = 50; var entityB = entityFactory.CreateExampleEntity("EntityB"); entityB.X = 120; entityB.Y = 100; // Don't forget to add your entities to the world! this.Entities.Add(entityA); this.Entities.Add(entityB); // This pulls in the texture asset via the asset manager. Note that // the folder seperator from "texture/Player" has been translated // into a single dot. _playerTexture = _assetManager.Get <TextureAsset>("texture.Player"); }
public void InitializeTile(ITileEntity entity, string tilesetAssetName) { entity.Tileset = _assetManager.Get <TilesetAsset>(tilesetAssetName); entity.Transform.LocalScale *= new Vector3(entity.Tileset.CellWidth, entity.Tileset.CellHeight, 1); entity.Width = entity.Tileset.CellWidth; entity.Height = entity.Tileset.CellHeight; }
public void Update(ComponentizedEntity entity, IGameContext gameContext, IUpdateContext updateContext) { if (!string.IsNullOrWhiteSpace(UserInterfaceAssetName)) { if (_userInterfaceAssetRef == null || _userInterfaceControllerAsset != UserInterfaceAssetName) { _userInterfaceAssetRef = _assetManager.Get <UserInterfaceAsset>(UserInterfaceAssetName); _userInterfaceControllerAsset = UserInterfaceAssetName; } if (_userInterfaceAssetRef.IsReady && _userInterfaceAssetRef.Asset != _userInterfaceAsset) { if (_userInterfaceController != null) { _userInterfaceController.Enabled = false; } _userInterfaceAsset = _userInterfaceAssetRef.Asset; _userInterfaceController = _userInterfaceFactory.CreateUserInterfaceController(_userInterfaceAsset); _userInterfaceController.Enabled = true; // Register behaviours. foreach (var behaviour in _behaviourRegistration) { behaviour(_userInterfaceController); } } } if (_userInterfaceController != null) { _userInterfaceController.Update(gameContext, updateContext); } }
public MyGameWorld( I2DRenderUtilities renderUtilities, IAssetManagerProvider assetManagerProvider, IEntityFactory entityFactory) { this.Entities = new List<IEntity>(); _renderUtilities = renderUtilities; _assetManager = assetManagerProvider.GetAssetManager(); _defaultFont = this._assetManager.Get<FontAsset>("font.Default"); // You can also save the entity factory in a field and use it, e.g. in the Update // loop or anywhere else in your game. var entityA = entityFactory.CreateExampleEntity("EntityA"); entityA.X = 100; entityA.Y = 50; var entityB = entityFactory.CreateExampleEntity("EntityB"); entityB.X = 120; entityB.Y = 100; // Don't forget to add your entities to the world! this.Entities.Add(entityA); this.Entities.Add(entityB); // This pulls in the texture asset via the asset manager. Note that // the folder seperator from "texture/Player" has been translated // into a single dot. _playerTexture = _assetManager.Get<TextureAsset>("texture.Player"); }
public DefaultStandardDirectionalLightRenderer( IAssetManager assetManager, IGraphicsBlit graphicsBlit) { _graphicsBlit = graphicsBlit; _directionalLightEffect = assetManager.Get <EffectAsset>("effect.DirectionalLight"); }
public void InitializeTile(ITileEntity entity, string tilesetAssetName) { entity.Tileset = _assetManager.Get <TilesetAsset>(tilesetAssetName); // TODO: Figure out how to do this with delayed assets. //entity.Transform.LocalScale *= new Vector3(entity.Tileset.CellWidth, entity.Tileset.CellHeight, 1); //entity.Width = entity.Tileset.CellWidth; //entity.Height = entity.Tileset.CellHeight; }
public NuiConsoleContainerSkinRenderer( I2DRenderUtilities renderUtilities, IAssetManager assetManager) { _renderUtilities = renderUtilities; _assetManager = assetManager; _fontAsset = assetManager.Get <FontAsset>("font.Console"); }
public Render3DPlaneComponent(INode node, I3DRenderUtilities renderUtilities, IAssetManager assetManager) { _node = node; _renderUtilities = renderUtilities; _defaultSurfaceEffect = assetManager.Get <UberEffectAsset>("effect.BuiltinSurface"); Enabled = true; }
public BasicLabelSkinRenderer( I2DRenderUtilities renderUtilities, IAssetManager assetManager, ILayoutPosition layoutPosition) { _renderUtilities = renderUtilities; _layoutPosition = layoutPosition; _fontAsset = assetManager.Get <FontAsset>("font.Default"); }
public InspectorRenderPass(IAssetManager assetManager) { _basicEffect = assetManager.Get <UberEffectAsset>("effect.BuiltinSurface"); Lines = new List <VertexPositionNormalColor>(); Triangles = new List <VertexPositionNormalColor>(); _enabledLayers = new List <IDebugLayer> { new InspectorDebugLayer() }; }
public PhysicsMetricsProfilerVisualiser( IAssetManager assetManager, I2DRenderUtilities renderUtilities, IPhysicsEngine physicsEngine) { _renderUtilities = renderUtilities; _physicsEngine = physicsEngine; _defaultFont = assetManager.Get <FontAsset>("font.Default"); }
public NuiLabelSkinRenderer( I2DRenderUtilities renderUtilities, IAssetManager assetManager, ILayoutPosition layoutPosition) { _renderUtilities = renderUtilities; _layoutPosition = layoutPosition; _fontAsset = assetManager.Get <FontAsset>("font.UISmall"); }
public NuiListItemSkinRenderer( I2DRenderUtilities renderUtilities, NuiRenderer nuiRenderer, IAssetManager assetManager) { _renderUtilities = renderUtilities; _nuiRenderer = nuiRenderer; _fontAsset = assetManager.Get <FontAsset>("font.UISmall"); }
public Default3DDeferredRenderPass( IHierarchy hierarchy, IRenderTargetBackBufferUtilities renderTargetBackBufferUtilities, IGraphicsBlit graphicsBlit, IAssetManager assetManager, IRenderBatcher renderBatcher) { _hierarchy = hierarchy; _renderTargetBackBufferUtilities = renderTargetBackBufferUtilities; _graphicsBlit = graphicsBlit; _renderBatcher = renderBatcher; _gbufferClearEffect = assetManager.Get <EffectAsset>("effect.GBufferClear"); _gbufferCombineEffect = assetManager.Get <EffectAsset>("effect.GBufferCombine"); GBufferBlendState = BlendState.Opaque; ClearTarget = true; }
public Render3DCubeComponent(INode node, I3DRenderUtilities renderUtilities, IAssetManager assetManager) { _node = node; _finalTransform = new DefaultFinalTransform(this, node); _renderUtilities = renderUtilities; _defaultSurfaceEffect = assetManager.Get <UberEffectAsset>("effect.BuiltinSurface"); Enabled = true; Transform = new DefaultTransform(); }
public KernelMetricsProfilerVisualiser( IKernel kernel, IHierarchy hierachy, IAssetManager assetManager, I2DRenderUtilities renderUtilities) { _kernel = kernel; _hierachy = hierachy; _renderUtilities = renderUtilities; _defaultFont = assetManager.Get <FontAsset>("font.Default"); }
public async Task <IAsset> Load(string name, IReadableSerializedAsset input, IAssetManager assetManager) { var textureName = input.GetString("TextureName"); return(new TilesetAsset( name, textureName, assetManager.Get <TextureAsset>(textureName), input.GetInt32("CellWidth"), input.GetInt32("CellHeight"))); }
public DefinitionListItem(IAssetManager assetManager, IDefinitionInfo definitionInfo) { DefinitionInfo = definitionInfo; if (definitionInfo.Type == "Content") { _icon = assetManager.Get <TextureAsset>("texture.IconImage"); } else if (definitionInfo.Role == "Server") { _icon = assetManager.Get <TextureAsset>("texture.IconServer"); } else if (definitionInfo.Role == "Game") { _icon = assetManager.Get <TextureAsset>("texture.IconGame"); } else { _icon = assetManager.Get <TextureAsset>("texture.IconCode"); } }
public DefaultStandardDirectionalLight( IAssetManager assetManager, IGraphicsBlit graphicsBlit, Vector3 lightDirection, Color lightColor) { _graphicsBlit = graphicsBlit; LightDirection = lightDirection; LightColor = lightColor; _directionalLightEffect = assetManager.Get <EffectAsset>("effect.DirectionalLight"); }
public NetworkTrafficProfilerVisualiser( IAssetManager assetManager, INetworkEngine networkEngine, I2DRenderUtilities renderUtilities) { _defaultFont = assetManager.Get <FontAsset>("font.Default"); _networkEngine = networkEngine; _renderUtilities = renderUtilities; _sentSampler = new NetworkSampler(_renderUtilities, _defaultFont, "SENT"); _receivedSampler = new NetworkSampler(_renderUtilities, _defaultFont, "RECV"); }
public GraphicsMetricsProfilerVisualiser( IAssetManager assetManager, I2DRenderUtilities renderUtilities, IRenderCache renderCache, IRenderAutoCache renderAutoCache, IRenderBatcher renderBatcher) { _renderUtilities = renderUtilities; _renderCache = renderCache; _renderAutoCache = renderAutoCache; _renderBatcher = renderBatcher; _defaultFont = assetManager.Get <FontAsset>("font.Default"); }
public BoardRendererEntity( BoardAnalyzerEntity analyzerEntity, WebcamEntity webcamEntity, IGraphicsBlit graphicsBlit, IAssetManager assetManager, TextBox alphaTextBox) { _analyzerEntity = analyzerEntity; _webcamEntity = webcamEntity; _graphicsBlit = graphicsBlit; _alphaTextBox = alphaTextBox; _warpFromPolygonEffect = assetManager.Get<EffectAsset>("effect.WarpFromPolygon"); }
public BoardAnalyzerEntity( DetectorEntity detectorEntity, TextBox pointThresholdTextBox, TextBox minNumberOfPointsTextBox, TextBox maxNumberOfPointsTextBox, I2DRenderUtilities renderUtilities, IAssetManager assetManager) { _detectorEntity = detectorEntity; _pointThresholdTextBox = pointThresholdTextBox; _minNumberOfPointsTextBox = minNumberOfPointsTextBox; _maxNumberOfPointsTextBox = maxNumberOfPointsTextBox; _renderUtilities = renderUtilities; _pointThresholdTextBox.Text = _pointThreshold.ToString(); _minNumberOfPointsTextBox.Text = _minNumberOfPoints.ToString(); _maxNumberOfPointsTextBox.Text = _maxNumberOfPoints.ToString(); _defaultFont = assetManager.Get<FontAsset>("font.Default"); _thread = new Thread(Run); _thread.IsBackground = true; _thread.Start(); }
public DetectorEntity(WebcamEntity webcamEntity, IAssetManager assetManager, I2DRenderUtilities renderUtilities) { _webcamEntity = webcamEntity; _assetManager = assetManager; _renderUtilities = renderUtilities; _defaultFont = _assetManager.Get<FontAsset>("font.Default"); _colorsToDetect = new List<ColorToDetect> { new ColorToDetect {Color = new Color(1f, 0f, 0f), Name = "Red"}, new ColorToDetect {Color = new Color(0f, 1f, 0f), Name = "Green"}, new ColorToDetect {Color = new Color(0f, 0f, 1f), Name = "Blue"}, new ColorToDetect {Color = new Color(1f, 1f, 0f), Name = "Yellow"} }; _currentIndex = 0; _currentColor = _colorsToDetect[_currentIndex]; GlobalSensitivity = 1/10000000f*25f; _thread = new Thread(ProcessorThread); _thread.IsBackground = true; _thread.Start(); }