From b886bf674bf11a8d2555debd49dfc92596ccd09f Mon Sep 17 00:00:00 2001 From: Calvin Wilkinson Date: Mon, 6 Nov 2023 18:25:08 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9CUpdate=20guides=20and=20latest=20AP?= =?UTF-8?q?I=20changes=20(#127)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Start work for issue #126 * config: set next version and enabled by default * docs: update to latest version of API v1.0.0-preview.30 * docs: update rendering text guide * docs: update rendering textures guide * docs: update rendering atlas textures guide * docs: update sound guide * docs: remove duplicate load content section and improve it * ide: improve markdown snippets * docs: make additional improvements to rendering text guide * docs: make additional improvements to rendering text guide ide: create task to create docs version ide: create launch config to create docs version config: create npm script to clean node modules directory ci,config: create script to generation new version of docs ide: add labels to all launch configs docs: create version 1.0.0-preview.30 of docs --- .../cicd/scripts/create-docusaurus-version.ts | 44 + .vscode/launch.json | 33 +- .vscode/mdx.code-snippets | 10 +- .vscode/tasks.json | 15 + docs/api/Velaptor.Content.ContentLoader.md | 230 ----- docs/api/Velaptor.Content.Fonts.FontLoader.md | 28 +- docs/api/Velaptor.Content.IContentLoader.md | 176 ---- docs/api/Velaptor.Content.md | 2 - ...r.Exceptions.EnumOutOfRangeException_T_.md | 98 --- docs/api/Velaptor.Exceptions.md | 1 - ...ptor.ExtensionMethods.ContentExtensions.md | 110 ++- ...Velaptor.Factories.ContentLoaderFactory.md | 14 - .../api/Velaptor.Factories.RendererFactory.md | 41 +- docs/api/Velaptor.Factories.md | 2 +- docs/api/Velaptor.Graphics.GlyphMetrics.md | 19 +- docs/api/Velaptor.Graphics.ImageData.md | 10 +- docs/api/Velaptor.Graphics.Renderers.md | 1 - docs/api/Velaptor.Input.KeyboardState.md | 12 +- docs/api/Velaptor.Input.MouseState.md | 17 +- docs/api/Velaptor.Scene.IScene.md | 13 - docs/api/Velaptor.Scene.SceneBase.md | 17 +- docs/api/Velaptor.UI.IWindow.md | 13 - docs/api/Velaptor.UI.Window.md | 15 - .../guides/rendering-atlas-textures.mdx | 94 +- docs/guides/guides/rendering-text.mdx | 128 +-- docs/guides/guides/rendering-textures.mdx | 64 +- docs/guides/guides/sounds.mdx | 52 +- docusaurus.config.js | 4 +- package.json | 3 +- .../guides/guides/rendering-text.mdx | 137 ++- .../guides/guides/rendering-text.mdx | 137 ++- .../guides/guides/rendering-text.mdx | 98 ++- .../guides/guides/rendering-text.mdx | 58 +- .../api/Namespaces.md | 28 + .../api/Velaptor.App.md | 50 ++ .../api/Velaptor.AppStats.md | 59 ++ .../api/Velaptor.Batching.IBatcher.md | 76 ++ .../api/Velaptor.Batching.md | 11 + .../api/Velaptor.Content.AtlasData.md | 232 +++++ .../api/Velaptor.Content.AtlasLoader.md | 109 +++ ...aching.IItemCache_TCacheKey,TCacheType_.md | 99 +++ .../api/Velaptor.Content.Caching.md | 11 + ...tor.Content.Exceptions.CachingException.md | 67 ++ ...ent.Exceptions.CachingMetaDataException.md | 67 ++ ...r.Content.Exceptions.LoadAtlasException.md | 67 ++ ...Content.Exceptions.LoadContentException.md | 67 ++ ...or.Content.Exceptions.LoadFontException.md | 67 ++ ...r.Content.Exceptions.LoadSoundException.md | 67 ++ ...Content.Exceptions.LoadTextureException.md | 67 ++ .../api/Velaptor.Content.Exceptions.md | 17 + .../api/Velaptor.Content.Fonts.Font.md | 372 ++++++++ .../api/Velaptor.Content.Fonts.FontLoader.md | 116 +++ .../api/Velaptor.Content.Fonts.FontSource.md | 40 + .../api/Velaptor.Content.Fonts.FontStyle.md | 33 + .../api/Velaptor.Content.Fonts.IFont.md | 306 +++++++ .../api/Velaptor.Content.Fonts.md | 21 + .../api/Velaptor.Content.IAtlasData.md | 128 +++ .../api/Velaptor.Content.IContent.md | 51 ++ .../api/Velaptor.Content.IContentLoadable.md | 53 ++ .../Velaptor.Content.IContentPathResolver.md | 85 ++ .../api/Velaptor.Content.ILoader_T_.md | 67 ++ .../api/Velaptor.Content.ISound.md | 66 ++ .../api/Velaptor.Content.ITexture.md | 60 ++ .../api/Velaptor.Content.Sound.md | 309 +++++++ .../api/Velaptor.Content.SoundLoader.md | 99 +++ .../api/Velaptor.Content.Texture.md | 153 ++++ .../api/Velaptor.Content.TextureLoader.md | 99 +++ .../api/Velaptor.Content.md | 26 + ...elaptor.Exceptions.AppSettingsException.md | 67 ++ .../api/Velaptor.Exceptions.AtlasException.md | 67 ++ ...xceptions.InvalidRenderEffectsException.md | 67 ++ ...xceptions.LoadEmbeddedResourceException.md | 67 ++ ...or.Exceptions.PushNotificationException.md | 90 ++ ....Exceptions.SceneAlreadyExistsException.md | 90 ++ ...aptor.Exceptions.SystemDisplayException.md | 67 ++ .../api/Velaptor.Exceptions.md | 17 + ...ptor.ExtensionMethods.ContentExtensions.md | 155 ++++ .../api/Velaptor.ExtensionMethods.md | 11 + ...Velaptor.Factories.ContentLoaderFactory.md | 73 ++ .../api/Velaptor.Factories.HardwareFactory.md | 73 ++ .../Velaptor.Factories.PathResolverFactory.md | 101 +++ .../api/Velaptor.Factories.RendererFactory.md | 47 +- .../api/Velaptor.Factories.md | 14 + .../api/Velaptor.FrameTime.md | 44 + .../api/Velaptor.GameHelpers.md | 803 ++++++++++++++++++ .../Velaptor.Graphics.AtlasSubTextureData.md | 58 ++ .../api/Velaptor.Graphics.CircleShape.md | 276 ++++++ .../api/Velaptor.Graphics.ColorGradient.md | 33 + .../api/Velaptor.Graphics.CornerRadius.md | 260 ++++++ .../api/Velaptor.Graphics.GlyphMetrics.md | 343 ++++++++ .../api/Velaptor.Graphics.IImageLoader.md | 39 + .../api/Velaptor.Graphics.IRenderContext.md | 58 ++ .../api/Velaptor.Graphics.IRenderMediator.md | 14 + .../api/Velaptor.Graphics.ImageData.md | 261 ++++++ .../api/Velaptor.Graphics.ImageLoader.md | 60 ++ .../api/Velaptor.Graphics.Line.md | 187 ++++ .../api/Velaptor.Graphics.RectShape.md | 340 ++++++++ .../api/Velaptor.Graphics.RenderEffects.md | 39 + ....Renderers.Exceptions.RendererException.md | 67 ++ .../Velaptor.Graphics.Renderers.Exceptions.md | 11 + ...laptor.Graphics.Renderers.IFontRenderer.md | 746 ++++++++++++++++ ...laptor.Graphics.Renderers.ILineRenderer.md | 306 +++++++ ...aptor.Graphics.Renderers.IShapeRenderer.md | 111 +++ ...tor.Graphics.Renderers.ITextureRenderer.md | 751 ++++++++++++++++ .../api/Velaptor.Graphics.Renderers.md | 14 + .../api/Velaptor.Graphics.md | 32 + .../api/Velaptor.Hardware.SystemDisplay.md | 191 +++++ .../api/Velaptor.Hardware.md | 11 + .../api/Velaptor.IDrawable.md | 32 + .../api/Velaptor.IPlatform.md | 57 ++ .../api/Velaptor.IUpdatable.md | 39 + ....Input.Exceptions.InvalidInputException.md | 67 ++ ...or.Input.Exceptions.NoKeyboardException.md | 67 ++ ...aptor.Input.Exceptions.NoMouseException.md | 67 ++ .../api/Velaptor.Input.Exceptions.md | 13 + .../api/Velaptor.Input.IAppInput_TState_.md | 37 + .../api/Velaptor.Input.KeyCode.md | 730 ++++++++++++++++ .../api/Velaptor.Input.KeyEventArgs.md | 49 ++ .../api/Velaptor.Input.KeyboardState.md | 431 ++++++++++ .../api/Velaptor.Input.MouseButton.md | 33 + .../Velaptor.Input.MouseScrollDirection.md | 33 + .../api/Velaptor.Input.MouseState.md | 363 ++++++++ .../api/Velaptor.Input.md | 23 + ...xceptions.BufferNotInitializedException.md | 73 ++ ...penGL.Exceptions.ShaderCompileException.md | 73 ++ ...r.OpenGL.Exceptions.ShaderLinkException.md | 73 ++ ...xceptions.ShaderNotInitializedException.md | 73 ++ .../api/Velaptor.OpenGL.Exceptions.md | 14 + .../api/Velaptor.Platform.md | 65 ++ .../api/Velaptor.Scene.IScene.md | 143 ++++ .../api/Velaptor.Scene.ISceneManager.md | 218 +++++ .../api/Velaptor.Scene.SceneBase.md | 217 +++++ .../api/Velaptor.Scene.md | 16 + .../api/Velaptor.SizeU.md | 68 ++ .../api/Velaptor.StateOfWindow.md | 42 + .../api/Velaptor.UI.Button.md | 410 +++++++++ .../api/Velaptor.UI.ControlBase.md | 412 +++++++++ .../api/Velaptor.UI.IControl.md | 221 +++++ .../api/Velaptor.UI.ISizable.md | 71 ++ .../api/Velaptor.UI.IWindow.md | 357 ++++++++ .../api/Velaptor.UI.Label.md | 224 +++++ .../api/Velaptor.UI.MouseMoveEventArgs.md | 68 ++ .../api/Velaptor.UI.TextBox.md | 221 +++++ .../api/Velaptor.UI.Window.md | 418 +++++++++ .../api/Velaptor.UI.md | 25 + .../api/Velaptor.WindowBorder.md | 36 + .../version-1.0.0-preview.30/api/Velaptor.md | 30 + .../guides/guides/_category_.json | 8 + .../guides/guides/adding-content.mdx | 79 ++ .../guides/guides/coming-soon/_category_.json | 8 + .../guides/coming-soon/rendering-lines.mdx | 10 + .../guides/coming-soon/rendering-rects.mdx | 10 + .../guides/guides/coming-soon/scenes.mdx | 10 + .../guides/coming-soon/system-monitors.mdx | 10 + .../guides/guides/coming-soon/windows.mdx | 10 + .../guides/guides/keyboard-input.mdx | 259 ++++++ .../guides/guides/mouse-input.mdx | 186 ++++ .../guides/guides/project-setup.mdx | 177 ++++ .../guides/rendering-atlas-textures.mdx | 492 +++++++++++ .../guides/guides/rendering-text.mdx | 448 ++++++++++ .../guides/guides/rendering-textures.mdx | 151 ++++ .../guides/guides/sounds.mdx | 317 +++++++ .../version-1.0.0-preview.30/guides/intro.mdx | 89 ++ .../version-1.0.0-preview.30-sidebars.json | 14 + versions.json | 1 + 165 files changed, 17936 insertions(+), 954 deletions(-) create mode 100644 .github/cicd/scripts/create-docusaurus-version.ts delete mode 100644 docs/api/Velaptor.Content.ContentLoader.md delete mode 100644 docs/api/Velaptor.Content.IContentLoader.md delete mode 100644 docs/api/Velaptor.Exceptions.EnumOutOfRangeException_T_.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Namespaces.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.App.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.AppStats.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Batching.IBatcher.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Batching.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.AtlasData.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.AtlasLoader.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Caching.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.CachingException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.CachingMetaDataException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadAtlasException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadContentException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadFontException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadSoundException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadTextureException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.Font.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontLoader.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontSource.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontStyle.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.IFont.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IAtlasData.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContent.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContentLoadable.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContentPathResolver.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ILoader_T_.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ISound.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ITexture.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Sound.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.SoundLoader.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Texture.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.TextureLoader.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.AppSettingsException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.AtlasException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.InvalidRenderEffectsException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.LoadEmbeddedResourceException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.PushNotificationException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.SceneAlreadyExistsException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.SystemDisplayException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.ExtensionMethods.ContentExtensions.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.ExtensionMethods.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.ContentLoaderFactory.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.HardwareFactory.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.PathResolverFactory.md rename docs/api/Velaptor.Graphics.Renderers.IRendererFactory.md => versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.RendererFactory.md (56%) create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.FrameTime.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.GameHelpers.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.AtlasSubTextureData.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.CircleShape.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ColorGradient.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.CornerRadius.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.GlyphMetrics.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IImageLoader.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IRenderContext.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IRenderMediator.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ImageData.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ImageLoader.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Line.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.RectShape.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.RenderEffects.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.Exceptions.RendererException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.Exceptions.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.IFontRenderer.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.ILineRenderer.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.IShapeRenderer.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.ITextureRenderer.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Hardware.SystemDisplay.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Hardware.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.IDrawable.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.IPlatform.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.IUpdatable.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.InvalidInputException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.NoKeyboardException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.NoMouseException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.IAppInput_TState_.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyCode.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyEventArgs.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyboardState.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseButton.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseScrollDirection.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseState.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.BufferNotInitializedException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderCompileException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderLinkException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderNotInitializedException.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Platform.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.IScene.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.ISceneManager.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.SceneBase.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.SizeU.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.StateOfWindow.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Button.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.ControlBase.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.IControl.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.ISizable.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.IWindow.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Label.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.MouseMoveEventArgs.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.TextBox.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Window.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.WindowBorder.md create mode 100644 versioned_docs/version-1.0.0-preview.30/api/Velaptor.md create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/_category_.json create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/adding-content.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/_category_.json create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/rendering-lines.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/rendering-rects.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/scenes.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/system-monitors.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/windows.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/keyboard-input.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/mouse-input.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/project-setup.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-atlas-textures.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-text.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-textures.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/guides/sounds.mdx create mode 100644 versioned_docs/version-1.0.0-preview.30/guides/intro.mdx create mode 100644 versioned_sidebars/version-1.0.0-preview.30-sidebars.json diff --git a/.github/cicd/scripts/create-docusaurus-version.ts b/.github/cicd/scripts/create-docusaurus-version.ts new file mode 100644 index 00000000..25143a90 --- /dev/null +++ b/.github/cicd/scripts/create-docusaurus-version.ts @@ -0,0 +1,44 @@ +import { Input } from "cliffy/prompt/input.ts"; + +console.clear(); + +const nodeJSDirPath = (Deno.env.get("PATH")?.split(";") + .find((path) => path.includes("nodejs")) ?? "").replace(/\\/g, "/"); + +const version = await Input.prompt({ + message: "Enter the name of the version you want to generate.", + hint: "Example: 1.2.3 or 1.2.3-preview.4", + minLength: 100, + validate: (input: string) => { + input = input.trim(); + return /^(|v)[0-9]+\.[0-9]+\.[0-9]+(|-preview\.[0-9]+)$/.test(input); + }, + transform: (input: string) => { + input = input.trim(); + + return input.startsWith("v") ? input.substring(1) : input; + } +}); + +console.log(`Chosen Version: ${version}`); + +const isWindows = Deno.build.os === "windows"; +const fullNPMPath = isWindows ? `${nodeJSDirPath}npm.cmd` : `${nodeJSDirPath}npm`; + +console.log(`OS NPM Path: ${fullNPMPath}`); + +const args = ["run", "docusaurus", "docs:version", version]; + +console.log(`Executing the command: ${args.join(" ")}`); +console.log(`Create API Docs Version '${version}'...`); + +const command = new Deno.Command(fullNPMPath, { + args: args, +}); + +const { code, stdout, stderr } = command.outputSync(); +console.assert(code === 0); +console.log(new TextDecoder().decode(stdout)); +console.log(new TextDecoder().decode(stderr)); + +console.log(`API Docs Version '${version}' Created Successfully!`); \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 16993897..fcec1fa8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,7 +4,7 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { + { // PLAYGROUND "name": "Playground (DEBUG)", "request": "launch", "type": "node", @@ -24,7 +24,7 @@ "runtimeExecutable": "${userHome}/.deno/bin/deno" } }, - { + { // RESET DOCS "request": "launch", "name": "Reset Docs", "type": "node", @@ -38,7 +38,7 @@ ], "attachSimplePort": 9229 }, - { + { // DELETE API DOCS "request": "launch", "name": "Delete API Docs (DEBUG)", "type": "node", @@ -53,7 +53,7 @@ "attachSimplePort": 9229, "console": "integratedTerminal" }, - { + { // DELETE OLDEST API DOCS "request": "launch", "name": "Delete Oldest API Docs (DEBUG)", "type": "node", @@ -69,7 +69,7 @@ "attachSimplePort": 9229, "console": "integratedTerminal" }, - { + { // ENABLE TESTING ENVIRONMENT "request": "launch", "name": "Enable Testing Env", "type": "node", @@ -86,7 +86,7 @@ ], "attachSimplePort": 9229 }, - { + { // UPDATE WEBSITE VERSION "request": "launch", "name": "Update Website Version", "type": "node", @@ -100,7 +100,7 @@ ], "attachSimplePort": 9229 }, - { + { // GENERATE NEW API DOCS "request": "launch", "name": "Generate New API Docs", "type": "node", @@ -120,7 +120,7 @@ "console": "integratedTerminal", "attachSimplePort": 9229 }, - { + { // VELAPTOR VERSION EXISTS "request": "launch", "name": "Velaptor Tag Exists", "type": "node", @@ -137,6 +137,21 @@ "${env:CICD_TOKEN}", ], "attachSimplePort": 9229 - } + }, + { // GENERATE DOCUSAURUS API DOCS VERSION + "request": "launch", + "name": "Genererate Docusaurus API Version", + "type": "node", + "program": "${workspaceFolder}/.github/cicd/scripts/create-docusaurus-version.ts", + "cwd": "${workspaceFolder}", + "runtimeExecutable": "${userHome}/.deno/bin/deno.EXE", + "runtimeArgs": [ + "run", + "--inspect-wait", + "--allow-all", + ], + "attachSimplePort": 9229, + "console": "integratedTerminal" + }, ] } diff --git a/.vscode/mdx.code-snippets b/.vscode/mdx.code-snippets index 0419db48..71f4e8d4 100644 --- a/.vscode/mdx.code-snippets +++ b/.vscode/mdx.code-snippets @@ -60,7 +60,7 @@ "scope": "mdx", "prefix": "note-admonition", "body": [ - ":::note ${1: Note Title}", + ":::note ${1:Note Title}", "${2: Note Content}", ":::\n" ], @@ -70,7 +70,7 @@ "scope": "mdx", "prefix": "tip-admonition", "body": [ - ":::tip ${1: Note Title}", + ":::tip ${1:Note Title}", "${2: Note Content}", ":::\n" ], @@ -80,7 +80,7 @@ "scope": "mdx", "prefix": "info-admonition", "body": [ - ":::info ${1: Note Title}", + ":::info ${1:Note Title}", "${2: Note Content}", ":::\n" ], @@ -90,7 +90,7 @@ "scope": "mdx", "prefix": "caution-admonition", "body": [ - ":::caution ${1: Note Title}", + ":::caution ${1:Note Title}", "${2: Note Content}", ":::\n" ], @@ -100,7 +100,7 @@ "scope": "mdx", "prefix": "danger-admonition", "body": [ - ":::danger ${1: Note Title}", + ":::danger ${1:Note Title}", "${2: Note Content}", ":::\n" ], diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 74228a47..b8b227f8 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -78,6 +78,7 @@ { // ENABLE NEXT VERSION "label": "Enable Next Version", "type": "shell", + "detail": "Enables the next version feature of docusaurus.", "windows": { "command": "deno", "args": [ @@ -90,6 +91,19 @@ ] } }, + { // CREATE DOCUSAURUS VERSION + "label": "Create Docusaurus Version", + "type": "shell", + "detail": "Creates a new docusaurus API version.", + "windows": { + "command": "deno", + "args": [ + "run", + "-A", + "${workspaceFolder}/.github/cicd/scripts/create-docusaurus-version.ts", + ] + } + }, { // BUILD "label": "build", "dependsOn": [ "Disable Testing Environment" ], @@ -102,6 +116,7 @@ { // DELETE API DOCS "label": "Delete API Docs", "dependsOn": [ "Disable Testing Environment" ], + "detail": "Deletes a version of the API docs.", "type": "shell", "windows": { "command": "deno", diff --git a/docs/api/Velaptor.Content.ContentLoader.md b/docs/api/Velaptor.Content.ContentLoader.md deleted file mode 100644 index 4ba4e0c1..00000000 --- a/docs/api/Velaptor.Content.ContentLoader.md +++ /dev/null @@ -1,230 +0,0 @@ ---- -title: Velaptor.Content.ContentLoader ---- - -#### [Velaptor](Namespaces.md 'Velaptor Namespaces') -### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') - -#### ContentLoader Class - -Loads content. - -```csharp -public sealed class ContentLoader : -Velaptor.Content.IContentLoader -``` - -Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ ContentLoader - -Implements [IContentLoader](Velaptor.Content.IContentLoader.md 'Velaptor.Content.IContentLoader') -## Constructors - - - -### ContentLoader(ILoader<ITexture>, ILoader<ISound>, ILoader<IAtlasData>, ILoader<IFont>) Constructor - -Initializes a new instance of the [ContentLoader](Velaptor.Content.ContentLoader.md 'Velaptor.Content.ContentLoader') class. - -```csharp -public ContentLoader(Velaptor.Content.ILoader textureLoader, Velaptor.Content.ILoader soundLoader, Velaptor.Content.ILoader atlasLoader, Velaptor.Content.ILoader fontLoader); -``` -#### Parameters - - - -`textureLoader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') - -Loads textures. - - - -`soundLoader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') - -Loads sounds. - - - -`atlasLoader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') - -Loads a texture atlas. - - - -`fontLoader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') - -Loads fonts for rendering text. -## Methods - - - -### LoadAtlas(string) - -Loads the texture atlas data using the given [nameOrFilePath](Velaptor.Content.ContentLoader.md#Velaptor.Content.ContentLoader.LoadAtlas(string).nameOrFilePath 'Velaptor.Content.ContentLoader.LoadAtlas(string).nameOrFilePath'). - -```csharp -public Velaptor.Content.IAtlasData LoadAtlas(string nameOrFilePath); -``` -#### Parameters - - - -`nameOrFilePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The name content in the application's content directory or direct file path to the content. - -Implements [LoadAtlas(string)](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.LoadAtlas(string) 'Velaptor.Content.IContentLoader.LoadAtlas(string)') - -#### Returns -[IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData') -The loaded texture atlas data. - - - -### LoadFont(string, uint) - -Loads font content using the given [nameOrFilePath](Velaptor.Content.ContentLoader.md#Velaptor.Content.ContentLoader.LoadFont(string,uint).nameOrFilePath 'Velaptor.Content.ContentLoader.LoadFont(string, uint).nameOrFilePath') and [size](Velaptor.Content.ContentLoader.md#Velaptor.Content.ContentLoader.LoadFont(string,uint).size 'Velaptor.Content.ContentLoader.LoadFont(string, uint).size'). - -```csharp -public Velaptor.Content.Fonts.IFont LoadFont(string nameOrFilePath, uint size); -``` -#### Parameters - - - -`nameOrFilePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The name content in the application's content directory or direct file path to the content. - - - -`size` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') - -The point size of the font. - -Implements [LoadFont(string, uint)](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.LoadFont(string,uint) 'Velaptor.Content.IContentLoader.LoadFont(string, uint)') - -#### Returns -[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') -The loaded font content. - - - -### LoadSound(string) - -Loads sound content using the given [nameOrFilePath](Velaptor.Content.ContentLoader.md#Velaptor.Content.ContentLoader.LoadSound(string).nameOrFilePath 'Velaptor.Content.ContentLoader.LoadSound(string).nameOrFilePath'). - -```csharp -public Velaptor.Content.ISound LoadSound(string nameOrFilePath); -``` -#### Parameters - - - -`nameOrFilePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The name content in the application's content directory or direct file path to the content. - -Implements [LoadSound(string)](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.LoadSound(string) 'Velaptor.Content.IContentLoader.LoadSound(string)') - -#### Returns -[ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound') -The loaded sound content. - - - -### LoadTexture(string) - -Loads texture content using the given [nameOrFilePath](Velaptor.Content.ContentLoader.md#Velaptor.Content.ContentLoader.LoadTexture(string).nameOrFilePath 'Velaptor.Content.ContentLoader.LoadTexture(string).nameOrFilePath'). - -```csharp -public Velaptor.Content.ITexture LoadTexture(string nameOrFilePath); -``` -#### Parameters - - - -`nameOrFilePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The name content in the application's content directory or direct file path to the content. - -Implements [LoadTexture(string)](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.LoadTexture(string) 'Velaptor.Content.IContentLoader.LoadTexture(string)') - -#### Returns -[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') -The loaded texture content. - - - -### UnloadAtlas(IAtlasData) - -Unloads the atlas data content. - -```csharp -public void UnloadAtlas(Velaptor.Content.IAtlasData content); -``` -#### Parameters - - - -`content` [IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData') - -The content to unload. - -Implements [UnloadAtlas(IAtlasData)](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.UnloadAtlas(Velaptor.Content.IAtlasData) 'Velaptor.Content.IContentLoader.UnloadAtlas(Velaptor.Content.IAtlasData)') - - - -### UnloadFont(IFont) - -Unloads the font. - -```csharp -public void UnloadFont(Velaptor.Content.Fonts.IFont content); -``` -#### Parameters - - - -`content` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') - -The content to unload. - -Implements [UnloadFont(IFont)](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.UnloadFont(Velaptor.Content.Fonts.IFont) 'Velaptor.Content.IContentLoader.UnloadFont(Velaptor.Content.Fonts.IFont)') - - - -### UnloadSound(ISound) - -Unloads the sound content. - -```csharp -public void UnloadSound(Velaptor.Content.ISound content); -``` -#### Parameters - - - -`content` [ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound') - -The content to unload. - -Implements [UnloadSound(ISound)](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.UnloadSound(Velaptor.Content.ISound) 'Velaptor.Content.IContentLoader.UnloadSound(Velaptor.Content.ISound)') - - - -### UnloadTexture(ITexture) - -Unloads the texture content. - -```csharp -public void UnloadTexture(Velaptor.Content.ITexture content); -``` -#### Parameters - - - -`content` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') - -The content to unload. - -Implements [UnloadTexture(ITexture)](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.UnloadTexture(Velaptor.Content.ITexture) 'Velaptor.Content.IContentLoader.UnloadTexture(Velaptor.Content.ITexture)') \ No newline at end of file diff --git a/docs/api/Velaptor.Content.Fonts.FontLoader.md b/docs/api/Velaptor.Content.Fonts.FontLoader.md index 4846afac..df8d0b21 100644 --- a/docs/api/Velaptor.Content.Fonts.FontLoader.md +++ b/docs/api/Velaptor.Content.Fonts.FontLoader.md @@ -59,7 +59,7 @@ The loaded font. Occurs when the [contentPathOrName](Velaptor.Content.Fonts.FontLoader.md#Velaptor.Content.Fonts.FontLoader.Load(string).contentPathOrName 'Velaptor.Content.Fonts.FontLoader.Load(string).contentPathOrName') argument is null or empty. [CachingMetaDataException](Velaptor.Content.Exceptions.CachingMetaDataException.md 'Velaptor.Content.Exceptions.CachingMetaDataException') -Occurs if the metadata is missing or invalid. +Occurs if the metadata is invalid. [System.IO.FileNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileNotFoundException 'System.IO.FileNotFoundException') Occurs if the font file does not exist. @@ -67,22 +67,34 @@ Occurs if the font file does not exist. ### Example ```csharp -// Valid Value +// Valid Example 1 ContentLoader.Load("my-font|size:12"); - -// Valid Value +
+// Valid Example 2 +ContentLoader.Load("my-font"); +
+// Valid Example 3 +ContentLoader.Load("my-font.ttf"); +
+// Valid Example 4 ContentLoader.Load(@"C:\fonts\my-font.ttf|size:12"); - -// Invalid Value +
+// Invalid Example 1 ContentLoader.Load("my-font|size:12"); - +
+// Invalid Example 2 ContentLoader.Load("my-font|size:12"); +
+// Invalid Example 3 +ContentLoader.Load("my-font|size12"); ``` #### Remarks If a path is used, it must be a fully qualified file path. -Directory paths are not valid. +Directory paths are not valid. + +If no metadata is provided, then a default font size of 12 will be used. diff --git a/docs/api/Velaptor.Content.IContentLoader.md b/docs/api/Velaptor.Content.IContentLoader.md deleted file mode 100644 index e6ded85d..00000000 --- a/docs/api/Velaptor.Content.IContentLoader.md +++ /dev/null @@ -1,176 +0,0 @@ ---- -title: Velaptor.Content.IContentLoader ---- - -#### [Velaptor](Namespaces.md 'Velaptor Namespaces') -### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') - -#### IContentLoader Interface - -Loads various kinds of content. - -```csharp -public interface IContentLoader -``` - -Derived -↳ [ContentLoader](Velaptor.Content.ContentLoader.md 'Velaptor.Content.ContentLoader') -## Methods - - - -### LoadAtlas(string) - -Loads the texture atlas data using the given [nameOrFilePath](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.LoadAtlas(string).nameOrFilePath 'Velaptor.Content.IContentLoader.LoadAtlas(string).nameOrFilePath'). - -```csharp -Velaptor.Content.IAtlasData LoadAtlas(string nameOrFilePath); -``` -#### Parameters - - - -`nameOrFilePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The name content in the application's content directory or direct file path to the content. - -#### Returns -[IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData') -The loaded texture atlas data. - - - -### LoadFont(string, uint) - -Loads font content using the given [nameOrFilePath](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.LoadFont(string,uint).nameOrFilePath 'Velaptor.Content.IContentLoader.LoadFont(string, uint).nameOrFilePath') and [size](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.LoadFont(string,uint).size 'Velaptor.Content.IContentLoader.LoadFont(string, uint).size'). - -```csharp -Velaptor.Content.Fonts.IFont LoadFont(string nameOrFilePath, uint size); -``` -#### Parameters - - - -`nameOrFilePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The name content in the application's content directory or direct file path to the content. - - - -`size` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') - -The point size of the font. - -#### Returns -[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') -The loaded font content. - - - -### LoadSound(string) - -Loads sound content using the given [nameOrFilePath](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.LoadSound(string).nameOrFilePath 'Velaptor.Content.IContentLoader.LoadSound(string).nameOrFilePath'). - -```csharp -Velaptor.Content.ISound LoadSound(string nameOrFilePath); -``` -#### Parameters - - - -`nameOrFilePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The name content in the application's content directory or direct file path to the content. - -#### Returns -[ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound') -The loaded sound content. - - - -### LoadTexture(string) - -Loads texture content using the given [nameOrFilePath](Velaptor.Content.IContentLoader.md#Velaptor.Content.IContentLoader.LoadTexture(string).nameOrFilePath 'Velaptor.Content.IContentLoader.LoadTexture(string).nameOrFilePath'). - -```csharp -Velaptor.Content.ITexture LoadTexture(string nameOrFilePath); -``` -#### Parameters - - - -`nameOrFilePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The name content in the application's content directory or direct file path to the content. - -#### Returns -[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') -The loaded texture content. - - - -### UnloadAtlas(IAtlasData) - -Unloads the atlas data content. - -```csharp -void UnloadAtlas(Velaptor.Content.IAtlasData content); -``` -#### Parameters - - - -`content` [IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData') - -The content to unload. - - - -### UnloadFont(IFont) - -Unloads the font. - -```csharp -void UnloadFont(Velaptor.Content.Fonts.IFont content); -``` -#### Parameters - - - -`content` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') - -The content to unload. - - - -### UnloadSound(ISound) - -Unloads the sound content. - -```csharp -void UnloadSound(Velaptor.Content.ISound content); -``` -#### Parameters - - - -`content` [ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound') - -The content to unload. - - - -### UnloadTexture(ITexture) - -Unloads the texture content. - -```csharp -void UnloadTexture(Velaptor.Content.ITexture content); -``` -#### Parameters - - - -`content` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') - -The content to unload. \ No newline at end of file diff --git a/docs/api/Velaptor.Content.md b/docs/api/Velaptor.Content.md index a437fdd5..a753909f 100644 --- a/docs/api/Velaptor.Content.md +++ b/docs/api/Velaptor.Content.md @@ -10,7 +10,6 @@ title: Velaptor.Content | :--- | :--- | | [AtlasData](Velaptor.Content.AtlasData.md 'Velaptor.Content.AtlasData') | Holds data relating to a texture atlas. | | [AtlasLoader](Velaptor.Content.AtlasLoader.md 'Velaptor.Content.AtlasLoader') | Loads atlas data. | -| [ContentLoader](Velaptor.Content.ContentLoader.md 'Velaptor.Content.ContentLoader') | Loads content. | | [Sound](Velaptor.Content.Sound.md 'Velaptor.Content.Sound') | A single sound that can be played, paused etc. | | [SoundLoader](Velaptor.Content.SoundLoader.md 'Velaptor.Content.SoundLoader') | Loads sound content. | | [Texture](Velaptor.Content.Texture.md 'Velaptor.Content.Texture') | The texture to render to a screen. | @@ -21,7 +20,6 @@ title: Velaptor.Content | [IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData') | Holds data for a texture atlas. | | [IContent](Velaptor.Content.IContent.md 'Velaptor.Content.IContent') | Represents loadable content data. | | [IContentLoadable](Velaptor.Content.IContentLoadable.md 'Velaptor.Content.IContentLoadable') | Provides the ability to load content. | -| [IContentLoader](Velaptor.Content.IContentLoader.md 'Velaptor.Content.IContentLoader') | Loads various kinds of content. | | [IContentPathResolver](Velaptor.Content.IContentPathResolver.md 'Velaptor.Content.IContentPathResolver') | Resolves file paths. | | [ILoader<T>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') | Loads data of type [T](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.T 'Velaptor.Content.ILoader.T'). | | [ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound') | A single sound that can be played, paused etc. | diff --git a/docs/api/Velaptor.Exceptions.EnumOutOfRangeException_T_.md b/docs/api/Velaptor.Exceptions.EnumOutOfRangeException_T_.md deleted file mode 100644 index 9b38ccb9..00000000 --- a/docs/api/Velaptor.Exceptions.EnumOutOfRangeException_T_.md +++ /dev/null @@ -1,98 +0,0 @@ ---- -title: Velaptor.Exceptions.EnumOutOfRangeException ---- - -#### [Velaptor](Namespaces.md 'Velaptor Namespaces') -### [Velaptor.Exceptions](Velaptor.Exceptions.md 'Velaptor.Exceptions') - -#### EnumOutOfRangeException<T> Class - -Thrown when an invalid [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') value is used. - -```csharp -public sealed class EnumOutOfRangeException : System.Exception - where T : System.Enum -``` -#### Type parameters - - - -`T` - -The type of enumeration. - -Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ EnumOutOfRangeException<T> -## Constructors - - - -### EnumOutOfRangeException() Constructor - -Initializes a new instance of the [EnumOutOfRangeException<T>](Velaptor.Exceptions.EnumOutOfRangeException_T_.md 'Velaptor.Exceptions.EnumOutOfRangeException') class. - -```csharp -public EnumOutOfRangeException(); -``` - - - -### EnumOutOfRangeException(string, string) Constructor - -Initializes a new instance of the [EnumOutOfRangeException<T>](Velaptor.Exceptions.EnumOutOfRangeException_T_.md 'Velaptor.Exceptions.EnumOutOfRangeException') class. - -```csharp -public EnumOutOfRangeException(string className, string methodName); -``` -#### Parameters - - - -`className` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The name of the class where the exception occurred. - - - -`methodName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The name of the method where the exception occured. - - - -### EnumOutOfRangeException(string, Exception) Constructor - -Initializes a new instance of the [EnumOutOfRangeException<T>](Velaptor.Exceptions.EnumOutOfRangeException_T_.md 'Velaptor.Exceptions.EnumOutOfRangeException') class. - -```csharp -public EnumOutOfRangeException(string message, System.Exception innerException); -``` -#### Parameters - - - -`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The message that describes the error. - - - -`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') - -The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. - - - -### EnumOutOfRangeException(string) Constructor - -Initializes a new instance of the [EnumOutOfRangeException<T>](Velaptor.Exceptions.EnumOutOfRangeException_T_.md 'Velaptor.Exceptions.EnumOutOfRangeException') class. - -```csharp -public EnumOutOfRangeException(string message); -``` -#### Parameters - - - -`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -The message that describes the error. \ No newline at end of file diff --git a/docs/api/Velaptor.Exceptions.md b/docs/api/Velaptor.Exceptions.md index 32ce07e8..cd223c21 100644 --- a/docs/api/Velaptor.Exceptions.md +++ b/docs/api/Velaptor.Exceptions.md @@ -10,7 +10,6 @@ title: Velaptor.Exceptions | :--- | :--- | | [AppSettingsException](Velaptor.Exceptions.AppSettingsException.md 'Velaptor.Exceptions.AppSettingsException') | Thrown when there is an issue loading the application settings. | | [AtlasException](Velaptor.Exceptions.AtlasException.md 'Velaptor.Exceptions.AtlasException') | Thrown when there is an issue with an atlas. | -| [EnumOutOfRangeException<T>](Velaptor.Exceptions.EnumOutOfRangeException_T_.md 'Velaptor.Exceptions.EnumOutOfRangeException') | Thrown when an invalid [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') value is used. | | [InvalidRenderEffectsException](Velaptor.Exceptions.InvalidRenderEffectsException.md 'Velaptor.Exceptions.InvalidRenderEffectsException') | Thrown when an invalid [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') value is used. | | [LoadEmbeddedResourceException](Velaptor.Exceptions.LoadEmbeddedResourceException.md 'Velaptor.Exceptions.LoadEmbeddedResourceException') | Occurs when something goes wrong with loading an embedded resource. | | [PushNotificationException](Velaptor.Exceptions.PushNotificationException.md 'Velaptor.Exceptions.PushNotificationException') | Thrown when there is an issue with the push notification system. | diff --git a/docs/api/Velaptor.ExtensionMethods.ContentExtensions.md b/docs/api/Velaptor.ExtensionMethods.ContentExtensions.md index 8ea86be0..d01d90ef 100644 --- a/docs/api/Velaptor.ExtensionMethods.ContentExtensions.md +++ b/docs/api/Velaptor.ExtensionMethods.ContentExtensions.md @@ -16,30 +16,30 @@ public static class ContentExtensions Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ ContentExtensions ## Methods - + -### Load(this FontLoader, string, uint) +### Load(this ILoader<IFont>, string, uint) Loads font content from the application's content directory or directly using a full file path. ```csharp -public static Velaptor.Content.Fonts.IFont Load(this Velaptor.Content.Fonts.FontLoader loader, string fontName, uint size); +public static Velaptor.Content.Fonts.IFont Load(this Velaptor.Content.ILoader loader, string fontName, uint size); ``` #### Parameters - + -`loader` [FontLoader](Velaptor.Content.Fonts.FontLoader.md 'Velaptor.Content.Fonts.FontLoader') +`loader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') The font loader. - + `fontName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') The name or full file path to the font with metadata. - + `size` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') @@ -52,7 +52,7 @@ The loaded font. #### Exceptions [System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') -Occurs when the [fontName](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Load(thisVelaptor.Content.Fonts.FontLoader,string,uint).fontName 'Velaptor.ExtensionMethods.ContentExtensions.Load(this Velaptor.Content.Fonts.FontLoader, string, uint).fontName') argument is null or empty. +Occurs when the [fontName](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Load(thisVelaptor.Content.ILoader_Velaptor.Content.Fonts.IFont_,string,uint).fontName 'Velaptor.ExtensionMethods.ContentExtensions.Load(this Velaptor.Content.ILoader, string, uint).fontName') argument is null or empty. [System.IO.FileNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileNotFoundException 'System.IO.FileNotFoundException') Occurs if the font file does not exist. @@ -62,48 +62,94 @@ If a path is used, it must be a fully qualified file path. Directory paths are not valid. - + -### Load(this ILoader<IFont>, string, uint) +### Unload(this ILoader<IFont>, IFont) -Loads font content from the application's content directory or directly using a full file path. +Unloads the given [font](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Unload(thisVelaptor.Content.ILoader_Velaptor.Content.Fonts.IFont_,Velaptor.Content.Fonts.IFont).font 'Velaptor.ExtensionMethods.ContentExtensions.Unload(this Velaptor.Content.ILoader, Velaptor.Content.Fonts.IFont).font'). ```csharp -public static Velaptor.Content.Fonts.IFont Load(this Velaptor.Content.ILoader loader, string fontName, uint size); +public static void Unload(this Velaptor.Content.ILoader loader, Velaptor.Content.Fonts.IFont? font); ``` #### Parameters - + `loader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') -The font loader. +The loader. - + -`fontName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') -The name or full file path to the font with metadata. +The content to unload. - + -`size` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') +### Unload(this ILoader<IAtlasData>, IAtlasData) -The size of the font. +Unloads the given [atlas](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Unload(thisVelaptor.Content.ILoader_Velaptor.Content.IAtlasData_,Velaptor.Content.IAtlasData).atlas 'Velaptor.ExtensionMethods.ContentExtensions.Unload(this Velaptor.Content.ILoader, Velaptor.Content.IAtlasData).atlas'). -#### Returns -[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') -The loaded font. +```csharp +public static void Unload(this Velaptor.Content.ILoader loader, Velaptor.Content.IAtlasData? atlas); +``` +#### Parameters -#### Exceptions + -[System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') -Occurs when the [fontName](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Load(thisVelaptor.Content.ILoader_Velaptor.Content.Fonts.IFont_,string,uint).fontName 'Velaptor.ExtensionMethods.ContentExtensions.Load(this Velaptor.Content.ILoader, string, uint).fontName') argument is null or empty. +`loader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') -[System.IO.FileNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileNotFoundException 'System.IO.FileNotFoundException') -Occurs if the font file does not exist. +The loader. -#### Remarks -If a path is used, it must be a fully qualified file path. - -Directory paths are not valid. \ No newline at end of file + + +`atlas` [IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData') + +The content to unload. + + + +### Unload(this ILoader<ISound>, ISound) + +Unloads the given [sound](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Unload(thisVelaptor.Content.ILoader_Velaptor.Content.ISound_,Velaptor.Content.ISound).sound 'Velaptor.ExtensionMethods.ContentExtensions.Unload(this Velaptor.Content.ILoader, Velaptor.Content.ISound).sound'). + +```csharp +public static void Unload(this Velaptor.Content.ILoader loader, Velaptor.Content.ISound? sound); +``` +#### Parameters + + + +`loader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') + +The loader. + + + +`sound` [ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound') + +The content to unload. + + + +### Unload(this ILoader<ITexture>, ITexture) + +Unloads the given [texture](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Unload(thisVelaptor.Content.ILoader_Velaptor.Content.ITexture_,Velaptor.Content.ITexture).texture 'Velaptor.ExtensionMethods.ContentExtensions.Unload(this Velaptor.Content.ILoader, Velaptor.Content.ITexture).texture'). + +```csharp +public static void Unload(this Velaptor.Content.ILoader loader, Velaptor.Content.ITexture? texture); +``` +#### Parameters + + + +`loader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') + +The loader. + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The content to unload. \ No newline at end of file diff --git a/docs/api/Velaptor.Factories.ContentLoaderFactory.md b/docs/api/Velaptor.Factories.ContentLoaderFactory.md index b7f0bd26..eaa6fee9 100644 --- a/docs/api/Velaptor.Factories.ContentLoaderFactory.md +++ b/docs/api/Velaptor.Factories.ContentLoaderFactory.md @@ -30,20 +30,6 @@ public static Velaptor.Content.ILoader CreateAtlasL [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') A loader for loading texture atlas data. - - -### CreateContentLoader() - -Creates a single instance of a content loader. - -```csharp -public static Velaptor.Content.IContentLoader CreateContentLoader(); -``` - -#### Returns -[IContentLoader](Velaptor.Content.IContentLoader.md 'Velaptor.Content.IContentLoader') -A framework content loader implementation. - ### CreateFontLoader() diff --git a/docs/api/Velaptor.Factories.RendererFactory.md b/docs/api/Velaptor.Factories.RendererFactory.md index 652e1bd3..f0fdd0bd 100644 --- a/docs/api/Velaptor.Factories.RendererFactory.md +++ b/docs/api/Velaptor.Factories.RendererFactory.md @@ -7,16 +7,13 @@ title: Velaptor.Factories.RendererFactory #### RendererFactory Class -Creates renderer instances. +Creates renderers for rendering different types of graphics. ```csharp -public sealed class RendererFactory : -Velaptor.Graphics.Renderers.IRendererFactory +public static class RendererFactory ``` Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ RendererFactory - -Implements [IRendererFactory](Velaptor.Graphics.Renderers.IRendererFactory.md 'Velaptor.Graphics.Renderers.IRendererFactory') ## Methods @@ -26,11 +23,9 @@ Implements [IRendererFactory](Velaptor.Graphics.Renderers.IRendererFactory.md 'V Creates an instance of [IBatcher](Velaptor.Batching.IBatcher.md 'Velaptor.Batching.IBatcher') to start and stop batching. ```csharp -public Velaptor.Batching.IBatcher CreateBatcher(); +public static Velaptor.Batching.IBatcher CreateBatcher(); ``` -Implements [CreateBatcher()](Velaptor.Graphics.Renderers.IRendererFactory.md#Velaptor.Graphics.Renderers.IRendererFactory.CreateBatcher() 'Velaptor.Graphics.Renderers.IRendererFactory.CreateBatcher()') - #### Returns [IBatcher](Velaptor.Batching.IBatcher.md 'Velaptor.Batching.IBatcher') The batcher instance. @@ -42,18 +37,13 @@ The batcher instance. Creates an instance of the [IFontRenderer](Velaptor.Graphics.Renderers.IFontRenderer.md 'Velaptor.Graphics.Renderers.IFontRenderer'). ```csharp -public Velaptor.Graphics.Renderers.IFontRenderer CreateFontRenderer(); +public static Velaptor.Graphics.Renderers.IFontRenderer CreateFontRenderer(); ``` -Implements [CreateFontRenderer()](Velaptor.Graphics.Renderers.IRendererFactory.md#Velaptor.Graphics.Renderers.IRendererFactory.CreateFontRenderer() 'Velaptor.Graphics.Renderers.IRendererFactory.CreateFontRenderer()') - #### Returns [IFontRenderer](Velaptor.Graphics.Renderers.IFontRenderer.md 'Velaptor.Graphics.Renderers.IFontRenderer') The font renderer. -#### Remarks -`NOTE:` the renderer is a singleton. - ### CreateLineRenderer() @@ -61,18 +51,13 @@ The font renderer. Creates an instance of the [ILineRenderer](Velaptor.Graphics.Renderers.ILineRenderer.md 'Velaptor.Graphics.Renderers.ILineRenderer'). ```csharp -public Velaptor.Graphics.Renderers.ILineRenderer CreateLineRenderer(); +public static Velaptor.Graphics.Renderers.ILineRenderer CreateLineRenderer(); ``` -Implements [CreateLineRenderer()](Velaptor.Graphics.Renderers.IRendererFactory.md#Velaptor.Graphics.Renderers.IRendererFactory.CreateLineRenderer() 'Velaptor.Graphics.Renderers.IRendererFactory.CreateLineRenderer()') - #### Returns [ILineRenderer](Velaptor.Graphics.Renderers.ILineRenderer.md 'Velaptor.Graphics.Renderers.ILineRenderer') The line renderer. -#### Remarks -`NOTE:` the renderer is a singleton. - ### CreateShapeRenderer() @@ -80,18 +65,13 @@ The line renderer. Creates an instance of the [IShapeRenderer](Velaptor.Graphics.Renderers.IShapeRenderer.md 'Velaptor.Graphics.Renderers.IShapeRenderer'). ```csharp -public Velaptor.Graphics.Renderers.IShapeRenderer CreateShapeRenderer(); +public static Velaptor.Graphics.Renderers.IShapeRenderer CreateShapeRenderer(); ``` -Implements [CreateShapeRenderer()](Velaptor.Graphics.Renderers.IRendererFactory.md#Velaptor.Graphics.Renderers.IRendererFactory.CreateShapeRenderer() 'Velaptor.Graphics.Renderers.IRendererFactory.CreateShapeRenderer()') - #### Returns [IShapeRenderer](Velaptor.Graphics.Renderers.IShapeRenderer.md 'Velaptor.Graphics.Renderers.IShapeRenderer') The rectangle renderer. -#### Remarks -`NOTE:` the renderer is a singleton. - ### CreateTextureRenderer() @@ -99,14 +79,9 @@ The rectangle renderer. Creates an instance of the [ITextureRenderer](Velaptor.Graphics.Renderers.ITextureRenderer.md 'Velaptor.Graphics.Renderers.ITextureRenderer'). ```csharp -public Velaptor.Graphics.Renderers.ITextureRenderer CreateTextureRenderer(); +public static Velaptor.Graphics.Renderers.ITextureRenderer CreateTextureRenderer(); ``` -Implements [CreateTextureRenderer()](Velaptor.Graphics.Renderers.IRendererFactory.md#Velaptor.Graphics.Renderers.IRendererFactory.CreateTextureRenderer() 'Velaptor.Graphics.Renderers.IRendererFactory.CreateTextureRenderer()') - #### Returns [ITextureRenderer](Velaptor.Graphics.Renderers.ITextureRenderer.md 'Velaptor.Graphics.Renderers.ITextureRenderer') -The texture renderer. - -#### Remarks -`NOTE:` the renderer is a singleton. \ No newline at end of file +The texture renderer. \ No newline at end of file diff --git a/docs/api/Velaptor.Factories.md b/docs/api/Velaptor.Factories.md index 72758c66..a30995b2 100644 --- a/docs/api/Velaptor.Factories.md +++ b/docs/api/Velaptor.Factories.md @@ -11,4 +11,4 @@ title: Velaptor.Factories | [ContentLoaderFactory](Velaptor.Factories.ContentLoaderFactory.md 'Velaptor.Factories.ContentLoaderFactory') | Creates instances of a content loader. | | [HardwareFactory](Velaptor.Factories.HardwareFactory.md 'Velaptor.Factories.HardwareFactory') | Generates input type objects for processing input such as the keyboard and mouse. | | [PathResolverFactory](Velaptor.Factories.PathResolverFactory.md 'Velaptor.Factories.PathResolverFactory') | Creates path resolver instances. | -| [RendererFactory](Velaptor.Factories.RendererFactory.md 'Velaptor.Factories.RendererFactory') | Creates renderer instances. | +| [RendererFactory](Velaptor.Factories.RendererFactory.md 'Velaptor.Factories.RendererFactory') | Creates renderers for rendering different types of graphics. | diff --git a/docs/api/Velaptor.Graphics.GlyphMetrics.md b/docs/api/Velaptor.Graphics.GlyphMetrics.md index 301292cd..23592c91 100644 --- a/docs/api/Velaptor.Graphics.GlyphMetrics.md +++ b/docs/api/Velaptor.Graphics.GlyphMetrics.md @@ -224,6 +224,8 @@ public float YMin { get; set; } ### Equals(object) +Determines whether the specified object is equal to the current object. + ```csharp public override bool Equals(object? obj); ``` @@ -233,13 +235,18 @@ public override bool Equals(object? obj); `obj` [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') +The object to compare with the current object. + #### Returns -[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +[true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') if the specified object is equal to the current object; otherwise, [false](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'). ### Equals(GlyphMetrics) +Defines a generalized method that a value type or class implements to create a type-specific method for determining equality of instances. + ```csharp public bool Equals(Velaptor.Graphics.GlyphMetrics other); ``` @@ -256,23 +263,29 @@ public bool Equals(Velaptor.Graphics.GlyphMetrics other); ### GetHashCode() +Returns the hash code for this instance. + ```csharp public override int GetHashCode(); ``` #### Returns -[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +A 32-bit signed integer that is the hash code for this instance. ### ToString() +Returns the fully qualified type name of this instance. + ```csharp public override string ToString(); ``` #### Returns -[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The fully qualified type name. ### Operators diff --git a/docs/api/Velaptor.Graphics.ImageData.md b/docs/api/Velaptor.Graphics.ImageData.md index a1bcafae..81e03fce 100644 --- a/docs/api/Velaptor.Graphics.ImageData.md +++ b/docs/api/Velaptor.Graphics.ImageData.md @@ -222,12 +222,15 @@ public void FlipVertically(); ### GetHashCode() +Returns the hash code for this instance. + ```csharp public override int GetHashCode(); ``` #### Returns -[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +A 32-bit signed integer that is the hash code for this instance. @@ -247,9 +250,12 @@ public bool IsEmpty(); ### ToString() +Returns the fully qualified type name of this instance. + ```csharp public override string ToString(); ``` #### Returns -[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The fully qualified type name. \ No newline at end of file diff --git a/docs/api/Velaptor.Graphics.Renderers.md b/docs/api/Velaptor.Graphics.Renderers.md index 7579c12c..091c5240 100644 --- a/docs/api/Velaptor.Graphics.Renderers.md +++ b/docs/api/Velaptor.Graphics.Renderers.md @@ -10,6 +10,5 @@ title: Velaptor.Graphics.Renderers | :--- | :--- | | [IFontRenderer](Velaptor.Graphics.Renderers.IFontRenderer.md 'Velaptor.Graphics.Renderers.IFontRenderer') | Renders text to the screen using a particular font. | | [ILineRenderer](Velaptor.Graphics.Renderers.ILineRenderer.md 'Velaptor.Graphics.Renderers.ILineRenderer') | Renders lines to the screen. | -| [IRendererFactory](Velaptor.Graphics.Renderers.IRendererFactory.md 'Velaptor.Graphics.Renderers.IRendererFactory') | Creates renderer instances. | | [IShapeRenderer](Velaptor.Graphics.Renderers.IShapeRenderer.md 'Velaptor.Graphics.Renderers.IShapeRenderer') | Renders rectangles to the screen. | | [ITextureRenderer](Velaptor.Graphics.Renderers.ITextureRenderer.md 'Velaptor.Graphics.Renderers.ITextureRenderer') | Renders textures to the screen. | diff --git a/docs/api/Velaptor.Input.KeyboardState.md b/docs/api/Velaptor.Input.KeyboardState.md index cf9a85aa..ca39d747 100644 --- a/docs/api/Velaptor.Input.KeyboardState.md +++ b/docs/api/Velaptor.Input.KeyboardState.md @@ -128,6 +128,8 @@ public bool AnyStandardNumberKeysDown(); ### Equals(object) +Indicates whether this instance and a specified object are equal. + ```csharp public override bool Equals(object? obj); ``` @@ -137,8 +139,11 @@ public override bool Equals(object? obj); `obj` [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') +The object to compare with the current instance. + #### Returns -[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +[true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') if [obj](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.Equals(object).obj 'Velaptor.Input.KeyboardState.Equals(object).obj') and this instance are the same type and represent the same value; otherwise, [false](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'). @@ -174,12 +179,15 @@ A list of the keys that are currently in the down position. ### GetHashCode() +Returns the hash code for this instance. + ```csharp public override int GetHashCode(); ``` #### Returns -[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +A 32-bit signed integer that is the hash code for this instance. diff --git a/docs/api/Velaptor.Input.MouseState.md b/docs/api/Velaptor.Input.MouseState.md index 66805ecb..d64c4e9d 100644 --- a/docs/api/Velaptor.Input.MouseState.md +++ b/docs/api/Velaptor.Input.MouseState.md @@ -35,6 +35,8 @@ True if any buttons are in the down position. ### Equals(object) +Indicates whether this instance and a specified object are equal. + ```csharp public override bool Equals(object? obj); ``` @@ -44,8 +46,11 @@ public override bool Equals(object? obj); `obj` [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') +The object to compare with the current instance. + #### Returns -[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +[true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') if [obj](Velaptor.Input.MouseState.md#Velaptor.Input.MouseState.Equals(object).obj 'Velaptor.Input.MouseState.Equals(object).obj') and this instance are the same type and represent the same value; otherwise, [false](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'). @@ -89,12 +94,15 @@ The button state to retrieve. ### GetHashCode() +Returns the hash code for this instance. + ```csharp public override int GetHashCode(); ``` #### Returns -[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +A 32-bit signed integer that is the hash code for this instance. @@ -210,6 +218,11 @@ The mouse button to check. [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') True if the mouse button is in the up position. +#### Exceptions + +[System.ComponentModel.InvalidEnumArgumentException](https://docs.microsoft.com/en-us/dotnet/api/System.ComponentModel.InvalidEnumArgumentException 'System.ComponentModel.InvalidEnumArgumentException') +Occurs if the [MouseButton](Velaptor.Input.MouseButton.md 'Velaptor.Input.MouseButton') is an invalid value. + ### IsLeftButtonDown() diff --git a/docs/api/Velaptor.Scene.IScene.md b/docs/api/Velaptor.Scene.IScene.md index 6ad88a5d..08f00a56 100644 --- a/docs/api/Velaptor.Scene.IScene.md +++ b/docs/api/Velaptor.Scene.IScene.md @@ -22,19 +22,6 @@ Derived Implements [IUpdatable](Velaptor.IUpdatable.md 'Velaptor.IUpdatable'), [IDrawable](Velaptor.IDrawable.md 'Velaptor.IDrawable'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable') ## Properties - - -### ContentLoader - -Gets the content loader. - -```csharp -Velaptor.Content.IContentLoader ContentLoader { get; } -``` - -#### Property Value -[IContentLoader](Velaptor.Content.IContentLoader.md 'Velaptor.Content.IContentLoader') - ### Id diff --git a/docs/api/Velaptor.Scene.SceneBase.md b/docs/api/Velaptor.Scene.SceneBase.md index 7a8e04f6..63943ced 100644 --- a/docs/api/Velaptor.Scene.SceneBase.md +++ b/docs/api/Velaptor.Scene.SceneBase.md @@ -22,21 +22,6 @@ Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.O Implements [IScene](Velaptor.Scene.IScene.md 'Velaptor.Scene.IScene'), [IUpdatable](Velaptor.IUpdatable.md 'Velaptor.IUpdatable'), [IDrawable](Velaptor.IDrawable.md 'Velaptor.IDrawable'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable') ## Properties - - -### ContentLoader - -Gets the content loader. - -```csharp -public Velaptor.Content.IContentLoader ContentLoader { get; } -``` - -Implements [ContentLoader](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.ContentLoader 'Velaptor.Scene.IScene.ContentLoader') - -#### Property Value -[IContentLoader](Velaptor.Content.IContentLoader.md 'Velaptor.Content.IContentLoader') - ### Controls @@ -149,6 +134,8 @@ Implements [AddControl(IControl)](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene ### Dispose() +Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + ```csharp public void Dispose(); ``` diff --git a/docs/api/Velaptor.UI.IWindow.md b/docs/api/Velaptor.UI.IWindow.md index 36c85754..8c0950aa 100644 --- a/docs/api/Velaptor.UI.IWindow.md +++ b/docs/api/Velaptor.UI.IWindow.md @@ -100,19 +100,6 @@ bool AutoSceneUpdating { get; set; } #### Property Value [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') - - -### ContentLoader - -Gets or sets the content loader for loading content. - -```csharp -Velaptor.Content.IContentLoader ContentLoader { get; set; } -``` - -#### Property Value -[IContentLoader](Velaptor.Content.IContentLoader.md 'Velaptor.Content.IContentLoader') - ### Draw diff --git a/docs/api/Velaptor.UI.Window.md b/docs/api/Velaptor.UI.Window.md index 0995a065..f39bc12d 100644 --- a/docs/api/Velaptor.UI.Window.md +++ b/docs/api/Velaptor.UI.Window.md @@ -108,21 +108,6 @@ Implements [AutoSceneUpdating](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.AutoSc #### Property Value [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') - - -### ContentLoader - -Gets or sets the content loader for loading content. - -```csharp -public Velaptor.Content.IContentLoader ContentLoader { get; set; } -``` - -Implements [ContentLoader](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.ContentLoader 'Velaptor.UI.IWindow.ContentLoader') - -#### Property Value -[IContentLoader](Velaptor.Content.IContentLoader.md 'Velaptor.Content.IContentLoader') - ### Draw diff --git a/docs/guides/guides/rendering-atlas-textures.mdx b/docs/guides/guides/rendering-atlas-textures.mdx index d9cf18ba..bd3cd162 100644 --- a/docs/guides/guides/rendering-atlas-textures.mdx +++ b/docs/guides/guides/rendering-atlas-textures.mdx @@ -24,7 +24,7 @@ An atlas texture is a large image with multiple sub-images packed into a single of a particular format such as JSON or XML, that describes the location, size, and other kinds of metadata for each image in the atlas texture. :::info JSON -Don't know what _**JSON**_ is? If new to JSOn, click [here](https://www.youtube.com/watch?v=iiADhChRriM) for a great 10-minute video. +If you are new to **JSON**, click [here](https://www.youtube.com/watch?v=iiADhChRriM) for a great 10-minute video. ::: When [rendering textures](./rendering-textures) the standard way, you render the entire texture. @@ -130,17 +130,29 @@ If you have an image file with no metadata file or vice versa, Velaptor will thr letting you know that _**one**_, the _**other**_, or _**both**_ are missing. ::: +## Step 4: Create class fields -## Step 4: Basic setup - -In the `Game` class, add the code below to set up the window and create a texture renderer. +Create the following class fields which will be used for holding content data, loading content, and rendering content. ```csharp public class Game : Window { - private readonly ITextureRenderer textureRenderer; // class field - private readonly IBatcher batcher; + private readonly ITextureRenderer textureRenderer; // Renders textures + private readonly IBatcher batcher; // Batches the rendering of textures + private ILoader? atlasLoader; // Loads the atlas data + private AtlasSubTextureData[]? subTextureData; // Holds all of the atlas data + private ITexture? atlasTexture; // The atlas texture +} +``` + +## Step 5: Basic setup + +In the `Game` class, add the following code to the constructor to set up the window, create a texture renderer, and the batcher. +```csharp +public class Game : Window +{ + ... public Game() { Title = "Atlas Textures"; @@ -156,25 +168,18 @@ public class Game : Window ``` -## Step 5: Load the content - -### Step 5.1: Create atlas data fields +## Step 6: Load and unload the content -```csharp -public class Game: Window -{ - ... - private AtlasSubTextureData[]? subTextureData; -} -``` - -### Step 5.2: Load atlas data +### Step 6.1: Load texture atlas content -Next, let's create an `OnLoad()` method override and add code to the method to load the atlas data. +Next, let's create the `OnLoad()` override method and add code to the method to create an atlas +loader and load the atlas data. ```csharp protected override void OnLoad() { + this.atlasLoader = ContentLoaderFactory.CreateAtlasLoader(this.batcher); + // Loads the atlas.png and atlas.json file var atlasData = ContentLoader.LoadAtlas("atlas"); @@ -184,6 +189,7 @@ protected override void OnLoad() base.OnLoad(); } ``` + The `atlasData` variable will contain the loaded texture and the metadata for the texture. We can use this data to make decisions on animation, positioning and more. @@ -234,12 +240,42 @@ sub-texture, you would call `GetFrames("ship")` and you would only get an array ::: +### Step 6.2: Unload content -## Step 6: Let's animate +Now we can unload the content when the game shuts down. This is to clean up resources that are no longer needed. +To do this, we can override the `OnUnload()` method. We can then call the `Unload()` method on the atlas loader +and send in the `IAtlasData` class field we created earlier. To do this, we need to add the `Velaptor.ExtensionMethods` namespace +to the top of the file. + +Add the following using statement. + +```csharp +... +using Velaptor.ExtensionMethods; // Add this line here +... +public class Game : Window +{ + ... +} +``` + +Now we can override the `OnUnload()` method and unload the font. + +```csharp +protected override void OnUnload() +{ + this.atlasLoader.Unload(this.atlasTexture); + base.OnUnload(); +} + +``` + + +## Step 7: Let's animate Now that we have loaded the atlas data, let's add some code to the `OnUpdate()` method to animate the sub-textures. -### Step 6.1: Tracking time +### Step 7.1: Tracking time For us to run an animation, we need to keep track of how much time has passed. Add the following fields to the `Game` class. @@ -270,7 +306,7 @@ How fast you want to run your animation is up to you. You can make it run as fas ::: -### Step 6.2: Has enough time passed? +### Step 7.2: Has enough time passed? Add some code to the `OnUpdate()` method to check if enough time has passed to change the frame of the animation. @@ -346,7 +382,7 @@ happen at a certain frequency. In this case, the speed at which we want our anim ::: -## Step 7: Render animation +## Step 8: Render animation Now we can finally render the animation to the screen. Add the following code to the `OnDraw()` method. @@ -391,9 +427,7 @@ the current frame or sub-texture is located. We then render only that sub-textur The `srcRect` and `destRect` variables are what tell Velaptor the _**section**_ of the atlas to render. -The - -## Step 8: Run it +## Step 9: Run it Run the game and see the results! You should see a small window with a blue flame animating in the center of the window as shown below. @@ -405,12 +439,12 @@ The animation will be much smoother than what is shown here. ![Flame Animation](@site/static/img/tutorials/guides/rendering-atlas-textures/flame.gif) -## Step 9: Bonus +## Step 10: Bonus You do not have to do this step of course, but what is game development without a little bit of extra fun? Let's improve the randomness of the flame animation. -### Step 9.1: Add more fields +### Step 10.1: Add more fields Add two more class fields to the `Game` class. The `random` field will be used to randomly choose between horizontal or non-horizontal orientation. The `horizontalLayout` field will be the layout setting at the time of rendering. @@ -425,7 +459,7 @@ public class Game: Window } ``` -### Step 9.2: Add flip behavior +### Step 10.2: Add flip behavior Add the following code to randomly choose whether or not the flame should be flipped horizontally to the bottom of the `if` block. This will choose a number between the values 0 and 1. If 0 is chosen, @@ -452,7 +486,7 @@ protected override void OnUpdate(FrameTime frameTime) } ``` -### Step 9.3: Run it +### Step 10.3: Run it Now run your game again and the flame will be a little bit more realistic to the randomness of the orientation of the flame!! diff --git a/docs/guides/guides/rendering-text.mdx b/docs/guides/guides/rendering-text.mdx index 23806414..22b4d448 100644 --- a/docs/guides/guides/rendering-text.mdx +++ b/docs/guides/guides/rendering-text.mdx @@ -37,51 +37,101 @@ public Game() ``` -## Step 3: Loading content +## Step 3: Loading and unload content -### Step 3.1: Create font field +### Step 3.1: Create class fields -Create a class field named `font` at the top of the class. This will be the loaded font to use for rendering text. +Create a couple class fields at the top of the class. These will be used to load the font for rendering text. ```csharp -private IFont? font; +private ILoader fontLoader; // Loads the font content +private IFont? font; // Holds the font ``` ### Step 3.2: Load the font -Now let's load the font using the `ContentLoader` property that belongs to the `Window` class. +We need to load the font and to do this we can use a loader. There are various loaders available in **Velaptor**. +The loader that we need is the `ILoader` loader and this can be created using the `ContentLoaderFactory`. +We want to keep the font loader around as a class field so we can unload the font later when shutting down the game. + +Add the following code to the `OnLoad()` method to create the font loader and load the font. ```csharp protected override void OnLoad() { - this.font = ContentLoader.LoadFont("TimesNewRoman-Regular", 24); // Loads the font into the class field + this.fontLoader = ContentLoaderFactory.CreateFontLoader(); + this.font = this.fontLoader.Load("TimesNewRoman-Regular", 24); + base.OnLoad(); } ``` +:::caution Warning +Since the name of the content to load is based on the name of the file, renaming the file will break your application!! +::: + :::tip content name The name of the content to load is the same as the content file minus the file extension. You can use or -omit the file extension when using the `ContentLoader.LoadFont()` method. Also, the name is not _**case-sensitive**_. +omit the file extension when using the `this.fontLoader.Load()` method. Also, the name is not _**case-sensitive**_. Example: The content names _**'my-texture'**_ and _**'My-Texture'**_ are equivalent. ::: -:::caution Warning -Since the name of the content to load is based on the name of the file, renaming the file will break your application!! +:::info Built In Fonts +
Expand me to learn more! + +Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. +The 4 different font types are: +- TimesNewRoman-Regular +- TimesNewRoman-Bold +- TimesNewRoman-Italic +- TimesNewRoman-BoldItalic + +
::: +### Step 3.3: Unload the font + +Now we can unload the content when the game shuts down. This is to clean up resources that are no longer needed. +To do this, we can override the `OnUnload()` method. We can then call the `Unload()` method on the font loader +and send in the `IFont` class field we created earlier. To do this, we need to add the `Velaptor.ExtensionMethods` namespace +to the top of the file. + + +Add the following using statement. + +```csharp +... +using Velaptor.ExtensionMethods; // Add this line here +... +public class Game : Window +{ + ... +} +``` + +Now we can override the `OnUnload()` method and unload the font. It is always a good idea to unload +and release resources when shutting down the game or when switching to a new scene. + +```csharp +protected override void OnUnload() +{ + this.fontLoader.Unload(this.font); + base.OnUnload(); +} +``` + ## Step 4: Rendering text ### Step 4.1: Create renderer field After setting up a text renderer and selecting a font for rendering text, we can now render text on the screen using the -font renderer. To achieve this, you can add the following code to the `OnDraw()` method. Remember to call `IBatcher.Begin()` -before using any `Render()` methods for any renderers, and then call `IBatcher.End()` when you're done with all the renderings. +font renderer. To achieve this, you can add the following code to the `OnDraw()` method. ```csharp public class Game : Window { ... - private readonly IFontRenderer fontRenderer; // Renders text + private readonly IFontRenderer fontRenderer; ... } ``` @@ -103,7 +153,7 @@ protected override void OnLoad() ### Step 4.3: Create batcher Create a batcher in the `OnLoad()` method. We can create a batcher using the `rendererFactory`. -We will go over what this is used for later in the guide. +We will go over what this is used in the next step. ```csharp protected override void OnLoad() @@ -115,41 +165,17 @@ protected override void OnLoad() } ``` - -### Step 4.4: Load the font - -Go into the `OnLoad()` method and add the code that loads the font. - -```csharp -protected override void OnLoad() -{ - ... - this.font = ContentLoader.LoadFont("TimesNewRoman-Regular", 24); - - base.OnLoad(); -} -``` -:::info Built In Fonts -
Expand me to learn more! - -Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. -The 4 different font types are: -- TimesNewRoman-Regular -- TimesNewRoman-Bold -- TimesNewRoman-Italic -- TimesNewRoman-BoldItalic - -
-::: - -### Step 4.5: Render the text - +### Step 4.4: Render the text Now that we have a text renderer and a font to render text, we need to use the font renderer to render some text to the screen using our font. Add the code below to the `OnDraw()` method to accomplish -this. Note that we need to invoke `IBatcher.Begin()` before we invoke any `Render()` methods for +this. + +Note that we need to invoke `IBatcher.Begin()` before we invoke any `Render()` methods for any renderers and then invoke the `IBatcher.End()` when we are finished with all of our renderings. +The X and Y values are set to 400, 400 which is the center of the window. + ```csharp protected override void OnDraw(FrameTime frameTime) { @@ -226,11 +252,13 @@ Every time the text bounces off the edge of the screen, we can change the color ### Step 5.1: Class fields To accomplish the bouncing of the text off the edges of the screen, we need to keep track of the position -and velocity of the text. Also, add the text that will be rendered as a `string const` as a class field as well. +and velocity of the text. Also, add the text that will be rendered as a `string` constant as a class field as well. You will see where this comes in later. -Let's add some class fields to store this information. +The velocity is what directly influences the movement of the text. The velocity is a vector that represents +the direction and magnitude of the text's movement. The position is the current position of the text on the screen. + ```csharp public class Game : Window @@ -294,11 +322,13 @@ private void ProcessCollisionAndColor() } ``` -Looking at the code, you can see how the positions of the sides of the text are calculated. Since the position of the text is relative to the -center of the text, we need to subtract or add the half or the width and height of the text from the position to get the left, top, right, and bottom. +Looking at the code, you can see how the positions of the sides of the text are calculated. Since the position +of the text is relative to the center of the text, we need to subtract or add half of the width and height of +the text from the position to get the left, top, right, and bottom positions. -With this information, we can then use it to compare against the sides of the window. If a collision occurs, we just flip out `X` or `Y` velocity -by negating it. Negating the velocity is what changes the direction of the text's movement. This is simple vector math. +With this information, we can then compare it against the sides of the window. If a collision occurs, we just +flip the sign of the X and/or Y velocity by negating it. Negating the velocity changes the direction of the +text's movement. This is just vector math. ### Step 5.3: Update position with collision diff --git a/docs/guides/guides/rendering-textures.mdx b/docs/guides/guides/rendering-textures.mdx index 6e5f8d4a..518731fd 100644 --- a/docs/guides/guides/rendering-textures.mdx +++ b/docs/guides/guides/rendering-textures.mdx @@ -26,14 +26,15 @@ For more info, refer to the [Project Setup](./project-setup) guide. ### Step 2.1: Create class fields -Create the `ITexture`, `ITextureRenderer`, and `IBatcher` class fields. This will be used to render the Velaptor mascot texture to the screen. +Create the class fields shown below. These will be used to render the Velaptor mascot texture to the screen. ```csharp public class Game : Window { - private ITextureRenderer textureRenderer; // Renders textures + private readonly IBatcher batcher; // Used to control batching + private readonly ITextureRenderer textureRenderer; // Renders textures private ITexture? mascotTexture; // The texture to render - private IBatcher batcher; // Used to control batching + private ILoader? textureLoader; // Used to load textures ... } ``` @@ -52,7 +53,13 @@ public Game() } ``` -### Step 2.3: Get content + +## Step 3: Load and unload the content + +Loading and unloading content is a very important part of game development. It is also important to unload the content +when it is not needed or used anymore. In the next couple of steps, we will setup the loading and unloading of the texture. + +### Step 3.1: Get the content Download or create any _**.png**_ file you want. @@ -60,27 +67,66 @@ Download or create any _**.png**_ file you want. You can download the Velaptor mascot here ::: -### Step 2.4: Add content +### Step 3.2: Add the content Add the image to the project and set it as content by following the steps in the [Adding Content](./adding-content) tutorial. Make sure to add the image to the `Content/Graphics` folder in the project. -### Step 2.5: Load content +### Step 3.3: Load the texture content Now that our content has been successfully added to the project, we can now move on to loading the texture and rendering it!! Let's load the texture to the class field in the `OnLoad()` method. +We need to load the texture and to do this we can use a loader. There are various loaders available in **Velaptor**. +The loader that we need is the `ILoader` loader and this can be created using the `ContentLoaderFactory`. + +Add the following code to the `OnLoad()` method to create the texture loader and load the texture. + ```csharp protected override void OnLoad() { - this.mascotTexture = ContentLoader.LoadTexture("velaptor-mascot"); + this.textureLoader = ContentLoaderFactory.CreateFontLoader(); + this.mascotTexture = this.textureLoader.Load("velaptor-mascot"); + base.OnLoad(); } ``` -### Step 2.6: Render the image +### Step 3.4: Unload the texture content + +Now we can unload the content when the game shuts down. This is to clean up resources that are no longer needed. +To do this, we can override the `OnUnload()` method. We can then call the `Unload()` method on the font loader +and send in the `IFont` class field we created earlier. To do this, we need to add the `Velaptor.ExtensionMethods` namespace +to the top of the file. + + +Add the following using statement. + +```csharp +... +using Velaptor.ExtensionMethods; // Add this line here +... +public class Game : Window +{ + ... +} +``` + +Now we can override the `OnUnload()` method and unload the font. + +```csharp +protected override void OnUnload() +{ + this.textureLoader.Unload(this.mascotTexture); + base.OnUnload(); +} + +``` + +## Step 4: Render the texture Finally, we can get to rendering our image. Add the code below to the `OnDraw()` method. + ```csharp protected override void OnDraw(FrameTime frameTime) { @@ -99,7 +145,7 @@ protected override void OnDraw(FrameTime frameTime) ``` -## Step 3: Run it +## Step 5: Run it Run the application. You should see the result below!! Example banner diff --git a/docs/guides/guides/sounds.mdx b/docs/guides/guides/sounds.mdx index 8c4dc737..eb416501 100644 --- a/docs/guides/guides/sounds.mdx +++ b/docs/guides/guides/sounds.mdx @@ -45,14 +45,15 @@ You only need the `OnLoad()` and `OnUpdate()` methods. ## Step 2: Create class fields -Create the `IAppInput`, `KeyboardState`, and `ISound?` class fields. These will be used to get the keyboard -input, hold the previous keyboard state for each loop iteration, and hold the loaded sound. +Create the required class fields that will be used to get the keyboard input, hold the previous keyboard state for +each loop iteration, load the sound content, and hold the loaded sound. ```csharp public class Game : Window { private IAppInput? keyboard; private KeyboardState prevKeyState; + private ILoader? soundLoader; private ISound? music; ... } @@ -71,7 +72,7 @@ public Game() ``` -## Step 4: Load the content +## Step 4: Load and unload the content Now, let's proceed with loading the sound as audio content for playback. Before we delve into the code for loading the audio content, it's crucial to add the audio file to the project as content. This step ensures it can be loaded. @@ -100,19 +101,21 @@ build output. This will be the default location where Velaptor will be looking For more info, refer to the [Adding Content](./adding-content) guide. ::: -### Step 4.3: Write code to load content +### Step 4.3: Load the content Now that we have the audio file added to the project, we can write some code to load the audio content. Add the following code to the `OnLoad()` method to load the sound and create our keyboard input object. ```csharp - protected override void OnLoad() - { - this.keyboard = HardwareFactory.GetMouse(); - this.music = ContentLoader.LoadSound("deep-consistency"); +protected override void OnLoad() +{ + this.keyboard = HardwareFactory.GetMouse(); + + this.soundLoader = ContentLoaderFactory.CreateSoundLoader(); + this.music = this.soundLoader.Load("deep-consistency"); - base.OnLoad(); - } + base.OnLoad(); +} ``` :::tip Content name @@ -120,6 +123,32 @@ Remember, the name of the audio file _**without its extension**_ will be the nam Example: 'deep-consistency.ogg' will become 'deep-consistency'. ::: +### Step 4.4: Unload the content + +We also need to unload the audio content when the window is closed. Add the following code to the `OnUnload()` method. + +**1.** Add a using statement at the top of the file to get access to some content extension methods. Though these are not required, +they make unloading content a bit easier. + +```csharp +... +using Velaptor.ExtensionMethods; // Add this line here +... +public class Game : Window +{ + ... +} +``` + +**2.** Create the `OnUnload()` method and add the following code to unload the audio content. + +```csharp +protected override void OnUnload() +{ + this.soundLoader.Unload(this.music); + base.OnUnload(); +} +``` ## Step 5: Displaying sound info @@ -128,7 +157,10 @@ if it's playing or paused, and some basic instructions for the user on how to co to be using the keyboard to control the sound, it makes sense to tell the user which keyboard keys to use to stop, play, and other sound-related operations. +:::info Note Title In the spirit of keeping things simple, we'll display the information in the title bar of the window. +You could absolutely display the information in the window itself by rendering text. +::: ### Step 5.1: Displaying audo state diff --git a/docusaurus.config.js b/docusaurus.config.js index f8cdca82..6f2dbf69 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -44,8 +44,8 @@ const config = { // This is used as part of the manual testing process for the CICD side of the project. // This will always be disabled during the build process before a release. // When disabled, the 'Next' version is enabled by default. - // - includeCurrentVersion: false, + // + // includeCurrentVersion: false, // }, diff --git a/package.json b/package.json index f910d267..895f78af 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", - "typecheck": "tsc" + "typecheck": "tsc", + "clean": "@powershell Remove-Item .\\node_modules -Force -Recurse" }, "dependencies": { "@docusaurus/core": "^2.4.1", diff --git a/versioned_docs/version-1.0.0-preview.26/guides/guides/rendering-text.mdx b/versioned_docs/version-1.0.0-preview.26/guides/guides/rendering-text.mdx index e899cf61..20f2aec2 100644 --- a/versioned_docs/version-1.0.0-preview.26/guides/guides/rendering-text.mdx +++ b/versioned_docs/version-1.0.0-preview.26/guides/guides/rendering-text.mdx @@ -11,7 +11,7 @@ import { TutorialLink } from "@site/src/components/TutorialLink"; This guide will show you the basics of rendering text to a window using **Velaptor**. :::note Guide Source Code -Go to the tutorial project to see the source code for a fully working example of this guide. +Go to the tutorial project to see the source code for a fully working example of this guide. ::: @@ -37,37 +37,87 @@ public Game() ``` -## Step 3: Loading content +## Step 3: Loading and unload content -### Step 3.1: Create font field +### Step 3.1: Create class fields -Create a class field named `font` at the top of the class. This will be the loaded font to use for rendering text. +Create a couple class fields at the top of the class. These will be used to load the font for rendering text. ```csharp private IFont? font; +private ILoader fontLoader; ``` ### Step 3.2: Load the font -Now let's load the font using the `ContentLoader` property that belongs to the `Window` class. +We need to load the font and to do this we can use a loader. There are various loaders available in **Velaptor**. +The loader that we need is the `ILoader` loader and this can be created using the `ContentLoaderFactory`. +We want to keep the font loader around as a class field so we can unload the font later when shutting down the game. + +Add the following code to the `OnLoad()` method to create the font loader and load the font. ```csharp protected override void OnLoad() { - this.font = ContentLoader.LoadFont("TimesNewRoman-Regular", 24); // Loads the font into the class field + this.fontLoader = ContentLoaderFactory.CreateFontLoader(); + this.font = this.fontLoader.Load("TimesNewRoman-Regular", 24); + base.OnLoad(); } ``` +:::caution Warning +Since the name of the content to load is based on the name of the file, renaming the file will break your application!! +::: + :::tip content name The name of the content to load is the same as the content file minus the file extension. You can use or -omit the file extension when using the `ContentLoader.LoadFont()` method. Also, the name is not _**case-sensitive**_. +omit the file extension when using the `this.fontLoader.Load()` method. Also, the name is not _**case-sensitive**_. Example: The content names _**'my-texture'**_ and _**'My-Texture'**_ are equivalent. ::: -:::caution Warning -Since the name of the content to load is based on the name of the file, renaming the file will break your application!! +:::info Built In Fonts +
Expand me to learn more! + +Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. +The 4 different font types are: +- TimesNewRoman-Regular +- TimesNewRoman-Bold +- TimesNewRoman-Italic +- TimesNewRoman-BoldItalic + +
::: +### Step 3.3: Unload the font + +Now we can unload the content when the game shuts down. This is to clean up resources that are no longer needed. +To do this, we can override the `OnUnload()` method. We can then call the `Unload()` method on the font loader +and send in the `IFont` class field we created earlier. To do this, we need to add the `Velaptor.ExtensionMethods` namespace +to the top of the file. + + +Add the following using statement. + +```csharp +... +using Velaptor.ExtensionMethods; // Add this line here +... +public class Game : Window +{ + ... +} +``` + +Now we can override the `OnUnload()` method and unload the font. + +```csharp +protected override void OnUnload() +{ + this.fontLoader.Unload(this.font); + base.OnUnload(); +} +``` + ## Step 4: Rendering text @@ -81,7 +131,7 @@ before using any `Render()` methods for any renderers, and then call `IBatcher.E public class Game : Window { ... - private readonly IFontRenderer fontRenderer; // Renders text + private readonly IFontRenderer fontRenderer; ... } ``` @@ -115,35 +165,7 @@ protected override void OnLoad() } ``` - -### Step 4.4: Load the font - -Go into the `OnLoad()` method and add the code that loads the font. - -```csharp -protected override void OnLoad() -{ - ... - this.font = ContentLoader.LoadFont("TimesNewRoman-Regular", 24); - - base.OnLoad(); -} -``` -:::info Built In Fonts -
Expand me to learn more! - -Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. -The 4 different font types are: -- TimesNewRoman-Regular -- TimesNewRoman-Bold -- TimesNewRoman-Italic -- TimesNewRoman-BoldItalic - -
-::: - -### Step 4.5: Render the text - +### Step 4.4: Render the text Now that we have a text renderer and a font to render text, we need to use the font renderer to render some text to the screen using our font. Add the code below to the `OnDraw()` method to accomplish @@ -356,7 +378,42 @@ private void RandomizeColor() } ``` -### Step 5.5: Finishing up +### Step 5.5: Update the color + +Now that we have our little helper method, we can use it in the `ProcessCollisionAndColor()` method. +Add a call to the `RandomizeColor()` method in each of the `if` statements that check for a collision. + +```csharp +private void ProcessCollision() +{ + ... + if (leftSide <= 0) + { + this.velocity.X *= -1; + RandomizeColor(); // Add this line + } + + if (top <= 0) + { + this.velocity.Y *= -1; + RandomizeColor(); // Add this line + } + + if (rightSide >= Width) + { + this.velocity.X *= -1; + RandomizeColor(); // Add this line + } + + if (bottom >= Height) + { + this.velocity.Y *= -1; + RandomizeColor(); // Add this line + } +} +``` + +### Step 5.6: Finishing up Now the exciting part!! Let's update the `OnDraw()` method to use our `position` and `textColor` class fields. No point in doing all of this hard work if we can see it. diff --git a/versioned_docs/version-1.0.0-preview.27/guides/guides/rendering-text.mdx b/versioned_docs/version-1.0.0-preview.27/guides/guides/rendering-text.mdx index e899cf61..20f2aec2 100644 --- a/versioned_docs/version-1.0.0-preview.27/guides/guides/rendering-text.mdx +++ b/versioned_docs/version-1.0.0-preview.27/guides/guides/rendering-text.mdx @@ -11,7 +11,7 @@ import { TutorialLink } from "@site/src/components/TutorialLink"; This guide will show you the basics of rendering text to a window using **Velaptor**. :::note Guide Source Code -Go to the tutorial project to see the source code for a fully working example of this guide. +Go to the tutorial project to see the source code for a fully working example of this guide. ::: @@ -37,37 +37,87 @@ public Game() ``` -## Step 3: Loading content +## Step 3: Loading and unload content -### Step 3.1: Create font field +### Step 3.1: Create class fields -Create a class field named `font` at the top of the class. This will be the loaded font to use for rendering text. +Create a couple class fields at the top of the class. These will be used to load the font for rendering text. ```csharp private IFont? font; +private ILoader fontLoader; ``` ### Step 3.2: Load the font -Now let's load the font using the `ContentLoader` property that belongs to the `Window` class. +We need to load the font and to do this we can use a loader. There are various loaders available in **Velaptor**. +The loader that we need is the `ILoader` loader and this can be created using the `ContentLoaderFactory`. +We want to keep the font loader around as a class field so we can unload the font later when shutting down the game. + +Add the following code to the `OnLoad()` method to create the font loader and load the font. ```csharp protected override void OnLoad() { - this.font = ContentLoader.LoadFont("TimesNewRoman-Regular", 24); // Loads the font into the class field + this.fontLoader = ContentLoaderFactory.CreateFontLoader(); + this.font = this.fontLoader.Load("TimesNewRoman-Regular", 24); + base.OnLoad(); } ``` +:::caution Warning +Since the name of the content to load is based on the name of the file, renaming the file will break your application!! +::: + :::tip content name The name of the content to load is the same as the content file minus the file extension. You can use or -omit the file extension when using the `ContentLoader.LoadFont()` method. Also, the name is not _**case-sensitive**_. +omit the file extension when using the `this.fontLoader.Load()` method. Also, the name is not _**case-sensitive**_. Example: The content names _**'my-texture'**_ and _**'My-Texture'**_ are equivalent. ::: -:::caution Warning -Since the name of the content to load is based on the name of the file, renaming the file will break your application!! +:::info Built In Fonts +
Expand me to learn more! + +Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. +The 4 different font types are: +- TimesNewRoman-Regular +- TimesNewRoman-Bold +- TimesNewRoman-Italic +- TimesNewRoman-BoldItalic + +
::: +### Step 3.3: Unload the font + +Now we can unload the content when the game shuts down. This is to clean up resources that are no longer needed. +To do this, we can override the `OnUnload()` method. We can then call the `Unload()` method on the font loader +and send in the `IFont` class field we created earlier. To do this, we need to add the `Velaptor.ExtensionMethods` namespace +to the top of the file. + + +Add the following using statement. + +```csharp +... +using Velaptor.ExtensionMethods; // Add this line here +... +public class Game : Window +{ + ... +} +``` + +Now we can override the `OnUnload()` method and unload the font. + +```csharp +protected override void OnUnload() +{ + this.fontLoader.Unload(this.font); + base.OnUnload(); +} +``` + ## Step 4: Rendering text @@ -81,7 +131,7 @@ before using any `Render()` methods for any renderers, and then call `IBatcher.E public class Game : Window { ... - private readonly IFontRenderer fontRenderer; // Renders text + private readonly IFontRenderer fontRenderer; ... } ``` @@ -115,35 +165,7 @@ protected override void OnLoad() } ``` - -### Step 4.4: Load the font - -Go into the `OnLoad()` method and add the code that loads the font. - -```csharp -protected override void OnLoad() -{ - ... - this.font = ContentLoader.LoadFont("TimesNewRoman-Regular", 24); - - base.OnLoad(); -} -``` -:::info Built In Fonts -
Expand me to learn more! - -Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. -The 4 different font types are: -- TimesNewRoman-Regular -- TimesNewRoman-Bold -- TimesNewRoman-Italic -- TimesNewRoman-BoldItalic - -
-::: - -### Step 4.5: Render the text - +### Step 4.4: Render the text Now that we have a text renderer and a font to render text, we need to use the font renderer to render some text to the screen using our font. Add the code below to the `OnDraw()` method to accomplish @@ -356,7 +378,42 @@ private void RandomizeColor() } ``` -### Step 5.5: Finishing up +### Step 5.5: Update the color + +Now that we have our little helper method, we can use it in the `ProcessCollisionAndColor()` method. +Add a call to the `RandomizeColor()` method in each of the `if` statements that check for a collision. + +```csharp +private void ProcessCollision() +{ + ... + if (leftSide <= 0) + { + this.velocity.X *= -1; + RandomizeColor(); // Add this line + } + + if (top <= 0) + { + this.velocity.Y *= -1; + RandomizeColor(); // Add this line + } + + if (rightSide >= Width) + { + this.velocity.X *= -1; + RandomizeColor(); // Add this line + } + + if (bottom >= Height) + { + this.velocity.Y *= -1; + RandomizeColor(); // Add this line + } +} +``` + +### Step 5.6: Finishing up Now the exciting part!! Let's update the `OnDraw()` method to use our `position` and `textColor` class fields. No point in doing all of this hard work if we can see it. diff --git a/versioned_docs/version-1.0.0-preview.28/guides/guides/rendering-text.mdx b/versioned_docs/version-1.0.0-preview.28/guides/guides/rendering-text.mdx index 23806414..20f2aec2 100644 --- a/versioned_docs/version-1.0.0-preview.28/guides/guides/rendering-text.mdx +++ b/versioned_docs/version-1.0.0-preview.28/guides/guides/rendering-text.mdx @@ -37,37 +37,87 @@ public Game() ``` -## Step 3: Loading content +## Step 3: Loading and unload content -### Step 3.1: Create font field +### Step 3.1: Create class fields -Create a class field named `font` at the top of the class. This will be the loaded font to use for rendering text. +Create a couple class fields at the top of the class. These will be used to load the font for rendering text. ```csharp private IFont? font; +private ILoader fontLoader; ``` ### Step 3.2: Load the font -Now let's load the font using the `ContentLoader` property that belongs to the `Window` class. +We need to load the font and to do this we can use a loader. There are various loaders available in **Velaptor**. +The loader that we need is the `ILoader` loader and this can be created using the `ContentLoaderFactory`. +We want to keep the font loader around as a class field so we can unload the font later when shutting down the game. + +Add the following code to the `OnLoad()` method to create the font loader and load the font. ```csharp protected override void OnLoad() { - this.font = ContentLoader.LoadFont("TimesNewRoman-Regular", 24); // Loads the font into the class field + this.fontLoader = ContentLoaderFactory.CreateFontLoader(); + this.font = this.fontLoader.Load("TimesNewRoman-Regular", 24); + base.OnLoad(); } ``` +:::caution Warning +Since the name of the content to load is based on the name of the file, renaming the file will break your application!! +::: + :::tip content name The name of the content to load is the same as the content file minus the file extension. You can use or -omit the file extension when using the `ContentLoader.LoadFont()` method. Also, the name is not _**case-sensitive**_. +omit the file extension when using the `this.fontLoader.Load()` method. Also, the name is not _**case-sensitive**_. Example: The content names _**'my-texture'**_ and _**'My-Texture'**_ are equivalent. ::: -:::caution Warning -Since the name of the content to load is based on the name of the file, renaming the file will break your application!! +:::info Built In Fonts +
Expand me to learn more! + +Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. +The 4 different font types are: +- TimesNewRoman-Regular +- TimesNewRoman-Bold +- TimesNewRoman-Italic +- TimesNewRoman-BoldItalic + +
::: +### Step 3.3: Unload the font + +Now we can unload the content when the game shuts down. This is to clean up resources that are no longer needed. +To do this, we can override the `OnUnload()` method. We can then call the `Unload()` method on the font loader +and send in the `IFont` class field we created earlier. To do this, we need to add the `Velaptor.ExtensionMethods` namespace +to the top of the file. + + +Add the following using statement. + +```csharp +... +using Velaptor.ExtensionMethods; // Add this line here +... +public class Game : Window +{ + ... +} +``` + +Now we can override the `OnUnload()` method and unload the font. + +```csharp +protected override void OnUnload() +{ + this.fontLoader.Unload(this.font); + base.OnUnload(); +} +``` + ## Step 4: Rendering text @@ -81,7 +131,7 @@ before using any `Render()` methods for any renderers, and then call `IBatcher.E public class Game : Window { ... - private readonly IFontRenderer fontRenderer; // Renders text + private readonly IFontRenderer fontRenderer; ... } ``` @@ -115,35 +165,7 @@ protected override void OnLoad() } ``` - -### Step 4.4: Load the font - -Go into the `OnLoad()` method and add the code that loads the font. - -```csharp -protected override void OnLoad() -{ - ... - this.font = ContentLoader.LoadFont("TimesNewRoman-Regular", 24); - - base.OnLoad(); -} -``` -:::info Built In Fonts -
Expand me to learn more! - -Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. -The 4 different font types are: -- TimesNewRoman-Regular -- TimesNewRoman-Bold -- TimesNewRoman-Italic -- TimesNewRoman-BoldItalic - -
-::: - -### Step 4.5: Render the text - +### Step 4.4: Render the text Now that we have a text renderer and a font to render text, we need to use the font renderer to render some text to the screen using our font. Add the code below to the `OnDraw()` method to accomplish diff --git a/versioned_docs/version-1.0.0-preview.29/guides/guides/rendering-text.mdx b/versioned_docs/version-1.0.0-preview.29/guides/guides/rendering-text.mdx index 23806414..065d85ca 100644 --- a/versioned_docs/version-1.0.0-preview.29/guides/guides/rendering-text.mdx +++ b/versioned_docs/version-1.0.0-preview.29/guides/guides/rendering-text.mdx @@ -37,7 +37,7 @@ public Game() ``` -## Step 3: Loading content +## Step 3: Loading and unloading the content ### Step 3.1: Create font field @@ -68,6 +68,31 @@ Example: The content names _**'my-texture'**_ and _**'My-Texture'**_ are equival Since the name of the content to load is based on the name of the file, renaming the file will break your application!! ::: +:::info Built In Fonts +
Expand me to learn more! + +Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. +The 4 different font types are: +- TimesNewRoman-Regular +- TimesNewRoman-Bold +- TimesNewRoman-Italic +- TimesNewRoman-BoldItalic + +
+::: + +### Step 3.3: Unload the font + +Unload the font to free resources when the application is closed. This is done in the `OnUnload()` method. +Create an override method and add the code to the method as shown below. + +```csharp +protected override void OnUnload() +{ + ContentLoader.UnloadFont(this.font); + base.OnUnload(); +} +``` ## Step 4: Rendering text @@ -115,34 +140,7 @@ protected override void OnLoad() } ``` - -### Step 4.4: Load the font - -Go into the `OnLoad()` method and add the code that loads the font. - -```csharp -protected override void OnLoad() -{ - ... - this.font = ContentLoader.LoadFont("TimesNewRoman-Regular", 24); - - base.OnLoad(); -} -``` -:::info Built In Fonts -
Expand me to learn more! - -Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. -The 4 different font types are: -- TimesNewRoman-Regular -- TimesNewRoman-Bold -- TimesNewRoman-Italic -- TimesNewRoman-BoldItalic - -
-::: - -### Step 4.5: Render the text +### Step 4.4: Render the text Now that we have a text renderer and a font to render text, we need to use the font renderer to render @@ -209,7 +207,7 @@ If you call a render method with any renderer before the `Begin()` method or aft you will get an exception!! This is a good thing because you want to know when you are not batching correctly. ::: -### Step 4.6: See the result +### Step 4.5: See the result Now for the best part!! Let's see the fruits of your labor and run the application. You should see the result below!! ๐Ÿฅณ diff --git a/versioned_docs/version-1.0.0-preview.30/api/Namespaces.md b/versioned_docs/version-1.0.0-preview.30/api/Namespaces.md new file mode 100644 index 00000000..92d5a359 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Namespaces.md @@ -0,0 +1,28 @@ +--- +title: Namespaces +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor API Namespaces + +| Namespaces | +| :--- | +| [Velaptor](Velaptor.md 'Velaptor') | +| [Velaptor.Batching](Velaptor.Batching.md 'Velaptor.Batching') | +| [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') | +| [Velaptor.Content.Caching](Velaptor.Content.Caching.md 'Velaptor.Content.Caching') | +| [Velaptor.Content.Exceptions](Velaptor.Content.Exceptions.md 'Velaptor.Content.Exceptions') | +| [Velaptor.Content.Fonts](Velaptor.Content.Fonts.md 'Velaptor.Content.Fonts') | +| [Velaptor.Exceptions](Velaptor.Exceptions.md 'Velaptor.Exceptions') | +| [Velaptor.ExtensionMethods](Velaptor.ExtensionMethods.md 'Velaptor.ExtensionMethods') | +| [Velaptor.Factories](Velaptor.Factories.md 'Velaptor.Factories') | +| [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') | +| [Velaptor.Graphics.Renderers](Velaptor.Graphics.Renderers.md 'Velaptor.Graphics.Renderers') | +| [Velaptor.Graphics.Renderers.Exceptions](Velaptor.Graphics.Renderers.Exceptions.md 'Velaptor.Graphics.Renderers.Exceptions') | +| [Velaptor.Hardware](Velaptor.Hardware.md 'Velaptor.Hardware') | +| [Velaptor.Input](Velaptor.Input.md 'Velaptor.Input') | +| [Velaptor.Input.Exceptions](Velaptor.Input.Exceptions.md 'Velaptor.Input.Exceptions') | +| [Velaptor.OpenGL.Exceptions](Velaptor.OpenGL.Exceptions.md 'Velaptor.OpenGL.Exceptions') | +| [Velaptor.Scene](Velaptor.Scene.md 'Velaptor.Scene') | +| [Velaptor.UI](Velaptor.UI.md 'Velaptor.UI') | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.App.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.App.md new file mode 100644 index 00000000..e03bd4e7 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.App.md @@ -0,0 +1,50 @@ +--- +title: Velaptor.App +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +#### App Class + +Represents a Velaptor application. + +```csharp +public static class App +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ App +## Methods + + + +### UseAvaloniaRenderContext(GL, uint, uint) + +Sets Velaptor to render to an Avalonia control. + +```csharp +public static Velaptor.Graphics.IRenderContext UseAvaloniaRenderContext(Silk.NET.OpenGL.GL gl, uint renderAreaWidth, uint renderAreaHeight); +``` +#### Parameters + + + +`gl` [Silk.NET.OpenGL.GL](https://docs.microsoft.com/en-us/dotnet/api/Silk.NET.OpenGL.GL 'Silk.NET.OpenGL.GL') + +The [Silk](https://docs.microsoft.com/en-us/dotnet/api/Silk 'Silk') OpenGL object. + + + +`renderAreaWidth` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The width of the render area. + + + +`renderAreaHeight` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The height of the render area. + +#### Returns +[IRenderContext](Velaptor.Graphics.IRenderContext.md 'Velaptor.Graphics.IRenderContext') +The Avalonia render context. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.AppStats.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.AppStats.md new file mode 100644 index 00000000..0d66ac0b --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.AppStats.md @@ -0,0 +1,59 @@ +--- +title: Velaptor.AppStats +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +#### AppStats Class + +Records and retrieves information about the running application. + +```csharp +public static class AppStats +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ AppStats +## Methods + + + +### GetFontGlyphRenderingData() + +Gets all of the rendered textures for the last two frames in `string` format. + +```csharp +public static string GetFontGlyphRenderingData(); +``` + +#### Returns +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The recorded frame information. + + + +### GetLoadedFonts() + +Returns all of the loaded fonts. + +```csharp +public static string GetLoadedFonts(); +``` + +#### Returns +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The string result of all the loaded fonts. + + + +### GetLoadedTextures() + +Returns all of the loaded textures. + +```csharp +public static string GetLoadedTextures(); +``` + +#### Returns +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The string result of all the loaded textures. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Batching.IBatcher.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Batching.IBatcher.md new file mode 100644 index 00000000..1083d4be --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Batching.IBatcher.md @@ -0,0 +1,76 @@ +--- +title: Velaptor.Batching.IBatcher +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Batching](Velaptor.Batching.md 'Velaptor.Batching') + +#### IBatcher Interface + +Provides the ability to start and end the batch rendering process. + +```csharp +public interface IBatcher +``` +## Properties + + + +### ClearColor + +Gets or sets the color of the back buffer when cleared. + +```csharp +System.Drawing.Color ClearColor { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### HasBegun + +Gets a value indicating whether or not the batch process has begun. + +```csharp +bool HasBegun { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +## Methods + + + +### Begin() + +Starts the batch rendering process. Must be called before invoking any render methods. + +```csharp +void Begin(); +``` + + + +### Clear() + +Clears the buffers. + +```csharp +void Clear(); +``` + +#### Remarks +It is best to clear the buffer before rendering all of the textures. +This is to make sure smearing does not occur during texture movement or animation. + + + +### End() + +Ends the batch process. Calling this will perform the actual GPU render process. + +```csharp +void End(); +``` \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Batching.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Batching.md new file mode 100644 index 00000000..6a6b7dcd --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Batching.md @@ -0,0 +1,11 @@ +--- +title: Velaptor.Batching +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Batching Namespace + +| Interfaces | | +| :--- | :--- | +| [IBatcher](Velaptor.Batching.IBatcher.md 'Velaptor.Batching.IBatcher') | Provides the ability to start and end the batch rendering process. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.AtlasData.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.AtlasData.md new file mode 100644 index 00000000..7d3acbd1 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.AtlasData.md @@ -0,0 +1,232 @@ +--- +title: Velaptor.Content.AtlasData +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### AtlasData Class + +Holds data relating to a texture atlas. + +```csharp +public sealed class AtlasData : +Velaptor.Content.IAtlasData, +Velaptor.Content.IContent +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ AtlasData + +Implements [IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData'), [IContent](Velaptor.Content.IContent.md 'Velaptor.Content.IContent') +## Constructors + + + +### AtlasData(IItemCache<string,ITexture>, IDirectory, IPath, IEnumerable<AtlasSubTextureData>, string, string) Constructor + +Initializes a new instance of the [AtlasData](Velaptor.Content.AtlasData.md 'Velaptor.Content.AtlasData') class. + +```csharp +public AtlasData(Velaptor.Content.Caching.IItemCache textureCache, System.IO.Abstractions.IDirectory directory, System.IO.Abstractions.IPath path, System.Collections.Generic.IEnumerable atlasSubTextureData, string dirPath, string atlasName); +``` +#### Parameters + + + +`textureCache` [Velaptor.Content.Caching.IItemCache<](Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md 'Velaptor.Content.Caching.IItemCache')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[,](Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md 'Velaptor.Content.Caching.IItemCache')[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture')[>](Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md 'Velaptor.Content.Caching.IItemCache') + +Caches textures for later use to improve performance. + + + +`directory` [System.IO.Abstractions.IDirectory](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IDirectory 'System.IO.Abstractions.IDirectory') + +Performs operations with directories. + + + +`path` [System.IO.Abstractions.IPath](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IPath 'System.IO.Abstractions.IPath') + +Processes directory and file paths. + + + +`atlasSubTextureData` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[AtlasSubTextureData](Velaptor.Graphics.AtlasSubTextureData.md 'Velaptor.Graphics.AtlasSubTextureData')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') + +The sub texture data of all sub textures in the atlas. + + + +`dirPath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The path to the content. + + + +`atlasName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the atlas. + +#### Exceptions + +[System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') +Thrown if any of the constructor parameters are null. + +[System.IO.DirectoryNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.DirectoryNotFoundException 'System.IO.DirectoryNotFoundException') +Thrown if the [dirPath](Velaptor.Content.AtlasData.md#Velaptor.Content.AtlasData.AtlasData(Velaptor.Content.Caching.IItemCache_string,Velaptor.Content.ITexture_,System.IO.Abstractions.IDirectory,System.IO.Abstractions.IPath,System.Collections.Generic.IEnumerable_Velaptor.Graphics.AtlasSubTextureData_,string,string).dirPath 'Velaptor.Content.AtlasData.AtlasData(Velaptor.Content.Caching.IItemCache, System.IO.Abstractions.IDirectory, System.IO.Abstractions.IPath, System.Collections.Generic.IEnumerable, string, string).dirPath') does not exist. +## Properties + + + +### AtlasDataFilePath + +Gets the file path to the atlas data. + +```csharp +public string AtlasDataFilePath { get; } +``` + +Implements [AtlasDataFilePath](Velaptor.Content.IAtlasData.md#Velaptor.Content.IAtlasData.AtlasDataFilePath 'Velaptor.Content.IAtlasData.AtlasDataFilePath') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### FilePath + +Gets the path to the texture. + +```csharp +public string FilePath { get; } +``` + +Implements [FilePath](Velaptor.Content.IContent.md#Velaptor.Content.IContent.FilePath 'Velaptor.Content.IContent.FilePath') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Height + +Gets the height of the entire texture atlas texture. + +```csharp +public uint Height { get; } +``` + +Implements [Height](Velaptor.Content.IAtlasData.md#Velaptor.Content.IAtlasData.Height 'Velaptor.Content.IAtlasData.Height') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Name + +Gets the name of the atlas. + +```csharp +public string Name { get; } +``` + +Implements [Name](Velaptor.Content.IContent.md#Velaptor.Content.IContent.Name 'Velaptor.Content.IContent.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### SubTextureNames + +Gets a list of unique sub texture names. + +```csharp +public System.Collections.Generic.IReadOnlyCollection SubTextureNames { get; } +``` + +Implements [SubTextureNames](Velaptor.Content.IAtlasData.md#Velaptor.Content.IAtlasData.SubTextureNames 'Velaptor.Content.IAtlasData.SubTextureNames') + +#### Property Value +[System.Collections.Generic.IReadOnlyCollection<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1') + +#### Remarks +Will not return duplicate names of animating sub textures. +Animating sub textures will have identical names. + + + +### Texture + +Gets the the texture of the atlas. + +```csharp +public Velaptor.Content.ITexture Texture { get; } +``` + +Implements [Texture](Velaptor.Content.IAtlasData.md#Velaptor.Content.IAtlasData.Texture 'Velaptor.Content.IAtlasData.Texture') + +#### Property Value +[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + + + +### this[int] + +The iterator for the atlas sub texture data. + +```csharp +public Velaptor.Graphics.AtlasSubTextureData this[int index] { get; } +``` +#### Parameters + + + +`index` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The index of the item to retrieve. + +Implements [this[int]](Velaptor.Content.IAtlasData.md#Velaptor.Content.IAtlasData.this[int] 'Velaptor.Content.IAtlasData.this[int]') + +#### Property Value +[AtlasSubTextureData](Velaptor.Graphics.AtlasSubTextureData.md 'Velaptor.Graphics.AtlasSubTextureData') + + + +### Width + +Gets the width of the entire texture atlas texture. + +```csharp +public uint Width { get; } +``` + +Implements [Width](Velaptor.Content.IAtlasData.md#Velaptor.Content.IAtlasData.Width 'Velaptor.Content.IAtlasData.Width') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') +## Methods + + + +### GetFrames(string) + +Gets the all of the frames that have the given sub texture id. + +```csharp +public Velaptor.Graphics.AtlasSubTextureData[] GetFrames(string subTextureId); +``` +#### Parameters + + + +`subTextureId` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The sub texture ID of the frames to return. + +Implements [GetFrames(string)](Velaptor.Content.IAtlasData.md#Velaptor.Content.IAtlasData.GetFrames(string) 'Velaptor.Content.IAtlasData.GetFrames(string)') + +#### Returns +[AtlasSubTextureData](Velaptor.Graphics.AtlasSubTextureData.md 'Velaptor.Graphics.AtlasSubTextureData')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') +The list of frame rectangles. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.AtlasLoader.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.AtlasLoader.md new file mode 100644 index 00000000..778eee3f --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.AtlasLoader.md @@ -0,0 +1,109 @@ +--- +title: Velaptor.Content.AtlasLoader +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### AtlasLoader Class + +Loads atlas data. + +```csharp +public sealed class AtlasLoader : +Velaptor.Content.ILoader +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ AtlasLoader + +Implements [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') +## Constructors + + + +### AtlasLoader() Constructor + +Initializes a new instance of the [AtlasLoader](Velaptor.Content.AtlasLoader.md 'Velaptor.Content.AtlasLoader') class. + +```csharp +public AtlasLoader(); +``` +## Methods + + + +### Load(string) + +Loads texture atlas data using the given [contentPathOrName](Velaptor.Content.AtlasLoader.md#Velaptor.Content.AtlasLoader.Load(string).contentPathOrName 'Velaptor.Content.AtlasLoader.Load(string).contentPathOrName'). + +```csharp +public Velaptor.Content.IAtlasData Load(string contentPathOrName); +``` +#### Parameters + + + +`contentPathOrName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The content name or file path to the atlas data. + +Implements [Load(string)](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.Load(string) 'Velaptor.Content.ILoader.Load(string)') + +#### Returns +[IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData') +The loaded atlas data. + +#### Exceptions + +[System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') +Thrown if the [contentPathOrName](Velaptor.Content.AtlasLoader.md#Velaptor.Content.AtlasLoader.Load(string).contentPathOrName 'Velaptor.Content.AtlasLoader.Load(string).contentPathOrName') is null or empty. + +[LoadTextureException](Velaptor.Content.Exceptions.LoadTextureException.md 'Velaptor.Content.Exceptions.LoadTextureException') +Thrown if the resulting texture content file path is invalid. + +[System.IO.FileNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileNotFoundException 'System.IO.FileNotFoundException') +Thrown if the texture file does not exist. + +[System.IO.IOException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.IOException 'System.IO.IOException') +The directory specified a file or the network name is not known. + +[System.UnauthorizedAccessException](https://docs.microsoft.com/en-us/dotnet/api/System.UnauthorizedAccessException 'System.UnauthorizedAccessException') +The caller does not have the required permissions. + +[System.IO.PathTooLongException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.PathTooLongException 'System.IO.PathTooLongException') +The specified path, file name, or both exceed the system-defined maximum length. + +[System.IO.DirectoryNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.DirectoryNotFoundException 'System.IO.DirectoryNotFoundException') +The specified path is invalid (for example, it is on an unmapped drive). + +[System.NotSupportedException](https://docs.microsoft.com/en-us/dotnet/api/System.NotSupportedException 'System.NotSupportedException') +The path contains a colon character `:` that is not part of a drive label. + +#### Remarks +Valid Values: +- MyAtlas +- C:/Atlas/MyAtlas.png +- C:/Atlas/MyAtlas.json + +Invalid Values: +- C:/Atlas/MyAtlas +- C:/Atlas/MyAtlas.txt + + + +### Unload(string) + +Unloads the data with the given [contentPathOrName](Velaptor.Content.AtlasLoader.md#Velaptor.Content.AtlasLoader.Unload(string).contentPathOrName 'Velaptor.Content.AtlasLoader.Unload(string).contentPathOrName'). + +```csharp +public void Unload(string contentPathOrName); +``` +#### Parameters + + + +`contentPathOrName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the content item to unload. + +Implements [Unload(string)](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.Unload(string) 'Velaptor.Content.ILoader.Unload(string)') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md new file mode 100644 index 00000000..8daec4da --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md @@ -0,0 +1,99 @@ +--- +title: Velaptor.Content.Caching.IItemCache +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Caching](Velaptor.Content.Caching.md 'Velaptor.Content.Caching') + +#### IItemCache<TCacheKey,TCacheType> Interface + +Caches items for retrieval at a later time. + +```csharp +public interface IItemCache +``` +#### Type parameters + + + +`TCacheKey` + +The unique key assigned for a particular cached item. + + + +`TCacheType` + +The type of item being cached. +## Properties + + + +### CacheKeys + +Gets the list of all cache keys. + +```csharp +System.Collections.Generic.IReadOnlyCollection CacheKeys { get; } +``` + +#### Property Value +[System.Collections.Generic.IReadOnlyCollection<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1') + + + +### TotalCachedItems + +Gets the total number of cached items. + +```csharp +int TotalCachedItems { get; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +## Methods + + + +### GetItem(TCacheKey) + +Gets a cached item that matches the given [cacheKey](Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md#Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.GetItem(TCacheKey).cacheKey 'Velaptor.Content.Caching.IItemCache.GetItem(TCacheKey).cacheKey'). + +```csharp +TCacheType GetItem(TCacheKey cacheKey); +``` +#### Parameters + + + +`cacheKey` [TCacheKey](Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md#Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.TCacheKey 'Velaptor.Content.Caching.IItemCache.TCacheKey') + +The unique key to identify a cached item. + +#### Returns +[TCacheType](Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md#Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.TCacheType 'Velaptor.Content.Caching.IItemCache.TCacheType') +The cached item. + +#### Remarks + +If the item does not already exist in the cache, it gets created, then cached. + +If the item does already exist in the cache, then that cached item is returned. + + + +### Unload(TCacheKey) + +Unloads a cached item that matches the given [cacheKey](Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md#Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.Unload(TCacheKey).cacheKey 'Velaptor.Content.Caching.IItemCache.Unload(TCacheKey).cacheKey'). + +```csharp +void Unload(TCacheKey cacheKey); +``` +#### Parameters + + + +`cacheKey` [TCacheKey](Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md#Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.TCacheKey 'Velaptor.Content.Caching.IItemCache.TCacheKey') + +The unique key to identify a cached item. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Caching.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Caching.md new file mode 100644 index 00000000..8c0d83c4 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Caching.md @@ -0,0 +1,11 @@ +--- +title: Velaptor.Content.Caching +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Content.Caching Namespace + +| Interfaces | | +| :--- | :--- | +| [IItemCache<TCacheKey,TCacheType>](Velaptor.Content.Caching.IItemCache_TCacheKey,TCacheType_.md 'Velaptor.Content.Caching.IItemCache') | Caches items for retrieval at a later time. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.CachingException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.CachingException.md new file mode 100644 index 00000000..dd7c9cac --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.CachingException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Content.Exceptions.CachingException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Exceptions](Velaptor.Content.Exceptions.md 'Velaptor.Content.Exceptions') + +#### CachingException Class + +Thrown when there is an issue caching items. + +```csharp +public sealed class CachingException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ CachingException +## Constructors + + + +### CachingException() Constructor + +Initializes a new instance of the [CachingException](Velaptor.Content.Exceptions.CachingException.md 'Velaptor.Content.Exceptions.CachingException') class. + +```csharp +public CachingException(); +``` + + + +### CachingException(string, Exception) Constructor + +Initializes a new instance of the [CachingException](Velaptor.Content.Exceptions.CachingException.md 'Velaptor.Content.Exceptions.CachingException') class. + +```csharp +public CachingException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### CachingException(string) Constructor + +Initializes a new instance of the [CachingException](Velaptor.Content.Exceptions.CachingException.md 'Velaptor.Content.Exceptions.CachingException') class. + +```csharp +public CachingException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.CachingMetaDataException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.CachingMetaDataException.md new file mode 100644 index 00000000..a9085d60 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.CachingMetaDataException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Content.Exceptions.CachingMetaDataException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Exceptions](Velaptor.Content.Exceptions.md 'Velaptor.Content.Exceptions') + +#### CachingMetaDataException Class + +Thrown when there is an issue with processing metadata, when loading fonts during the caching process. + +```csharp +public sealed class CachingMetaDataException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ CachingMetaDataException +## Constructors + + + +### CachingMetaDataException() Constructor + +Initializes a new instance of the [CachingMetaDataException](Velaptor.Content.Exceptions.CachingMetaDataException.md 'Velaptor.Content.Exceptions.CachingMetaDataException') class. + +```csharp +public CachingMetaDataException(); +``` + + + +### CachingMetaDataException(string, Exception) Constructor + +Initializes a new instance of the [CachingMetaDataException](Velaptor.Content.Exceptions.CachingMetaDataException.md 'Velaptor.Content.Exceptions.CachingMetaDataException') class. + +```csharp +public CachingMetaDataException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### CachingMetaDataException(string) Constructor + +Initializes a new instance of the [CachingMetaDataException](Velaptor.Content.Exceptions.CachingMetaDataException.md 'Velaptor.Content.Exceptions.CachingMetaDataException') class. + +```csharp +public CachingMetaDataException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadAtlasException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadAtlasException.md new file mode 100644 index 00000000..14e6b424 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadAtlasException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Content.Exceptions.LoadAtlasException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Exceptions](Velaptor.Content.Exceptions.md 'Velaptor.Content.Exceptions') + +#### LoadAtlasException Class + +Thrown when there is an issue loading atlas data content. + +```csharp +public sealed class LoadAtlasException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ LoadAtlasException +## Constructors + + + +### LoadAtlasException() Constructor + +Initializes a new instance of the [LoadAtlasException](Velaptor.Content.Exceptions.LoadAtlasException.md 'Velaptor.Content.Exceptions.LoadAtlasException') class. + +```csharp +public LoadAtlasException(); +``` + + + +### LoadAtlasException(string, Exception) Constructor + +Initializes a new instance of the [LoadAtlasException](Velaptor.Content.Exceptions.LoadAtlasException.md 'Velaptor.Content.Exceptions.LoadAtlasException') class. + +```csharp +public LoadAtlasException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### LoadAtlasException(string) Constructor + +Initializes a new instance of the [LoadAtlasException](Velaptor.Content.Exceptions.LoadAtlasException.md 'Velaptor.Content.Exceptions.LoadAtlasException') class. + +```csharp +public LoadAtlasException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadContentException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadContentException.md new file mode 100644 index 00000000..b0d8f6cd --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadContentException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Content.Exceptions.LoadContentException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Exceptions](Velaptor.Content.Exceptions.md 'Velaptor.Content.Exceptions') + +#### LoadContentException Class + +Thrown when there is an issue loading content. + +```csharp +public sealed class LoadContentException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ LoadContentException +## Constructors + + + +### LoadContentException() Constructor + +Initializes a new instance of the [LoadContentException](Velaptor.Content.Exceptions.LoadContentException.md 'Velaptor.Content.Exceptions.LoadContentException') class. + +```csharp +public LoadContentException(); +``` + + + +### LoadContentException(string, Exception) Constructor + +Initializes a new instance of the [LoadContentException](Velaptor.Content.Exceptions.LoadContentException.md 'Velaptor.Content.Exceptions.LoadContentException') class. + +```csharp +public LoadContentException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### LoadContentException(string) Constructor + +Initializes a new instance of the [LoadContentException](Velaptor.Content.Exceptions.LoadContentException.md 'Velaptor.Content.Exceptions.LoadContentException') class. + +```csharp +public LoadContentException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadFontException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadFontException.md new file mode 100644 index 00000000..db7f3eaa --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadFontException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Content.Exceptions.LoadFontException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Exceptions](Velaptor.Content.Exceptions.md 'Velaptor.Content.Exceptions') + +#### LoadFontException Class + +Thrown when there is an issue loading fonts. + +```csharp +public sealed class LoadFontException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ LoadFontException +## Constructors + + + +### LoadFontException() Constructor + +Initializes a new instance of the [LoadFontException](Velaptor.Content.Exceptions.LoadFontException.md 'Velaptor.Content.Exceptions.LoadFontException') class. + +```csharp +public LoadFontException(); +``` + + + +### LoadFontException(string, Exception) Constructor + +Initializes a new instance of the [LoadFontException](Velaptor.Content.Exceptions.LoadFontException.md 'Velaptor.Content.Exceptions.LoadFontException') class. + +```csharp +public LoadFontException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### LoadFontException(string) Constructor + +Initializes a new instance of the [LoadFontException](Velaptor.Content.Exceptions.LoadFontException.md 'Velaptor.Content.Exceptions.LoadFontException') class. + +```csharp +public LoadFontException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadSoundException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadSoundException.md new file mode 100644 index 00000000..0dbff4ec --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadSoundException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Content.Exceptions.LoadSoundException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Exceptions](Velaptor.Content.Exceptions.md 'Velaptor.Content.Exceptions') + +#### LoadSoundException Class + +Thrown when there is an issue loading sounds. + +```csharp +public sealed class LoadSoundException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ LoadSoundException +## Constructors + + + +### LoadSoundException() Constructor + +Initializes a new instance of the [LoadSoundException](Velaptor.Content.Exceptions.LoadSoundException.md 'Velaptor.Content.Exceptions.LoadSoundException') class. + +```csharp +public LoadSoundException(); +``` + + + +### LoadSoundException(string, Exception) Constructor + +Initializes a new instance of the [LoadSoundException](Velaptor.Content.Exceptions.LoadSoundException.md 'Velaptor.Content.Exceptions.LoadSoundException') class. + +```csharp +public LoadSoundException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### LoadSoundException(string) Constructor + +Initializes a new instance of the [LoadSoundException](Velaptor.Content.Exceptions.LoadSoundException.md 'Velaptor.Content.Exceptions.LoadSoundException') class. + +```csharp +public LoadSoundException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadTextureException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadTextureException.md new file mode 100644 index 00000000..5b6c2702 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.LoadTextureException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Content.Exceptions.LoadTextureException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Exceptions](Velaptor.Content.Exceptions.md 'Velaptor.Content.Exceptions') + +#### LoadTextureException Class + +Thrown when there is an issue loading textures. + +```csharp +public sealed class LoadTextureException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ LoadTextureException +## Constructors + + + +### LoadTextureException() Constructor + +Initializes a new instance of the [LoadTextureException](Velaptor.Content.Exceptions.LoadTextureException.md 'Velaptor.Content.Exceptions.LoadTextureException') class. + +```csharp +public LoadTextureException(); +``` + + + +### LoadTextureException(string, Exception) Constructor + +Initializes a new instance of the [LoadTextureException](Velaptor.Content.Exceptions.LoadTextureException.md 'Velaptor.Content.Exceptions.LoadTextureException') class. + +```csharp +public LoadTextureException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### LoadTextureException(string) Constructor + +Initializes a new instance of the [LoadTextureException](Velaptor.Content.Exceptions.LoadTextureException.md 'Velaptor.Content.Exceptions.LoadTextureException') class. + +```csharp +public LoadTextureException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.md new file mode 100644 index 00000000..6630f6bd --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Exceptions.md @@ -0,0 +1,17 @@ +--- +title: Velaptor.Content.Exceptions +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Content.Exceptions Namespace + +| Classes | | +| :--- | :--- | +| [CachingException](Velaptor.Content.Exceptions.CachingException.md 'Velaptor.Content.Exceptions.CachingException') | Thrown when there is an issue caching items. | +| [CachingMetaDataException](Velaptor.Content.Exceptions.CachingMetaDataException.md 'Velaptor.Content.Exceptions.CachingMetaDataException') | Thrown when there is an issue with processing metadata, when loading fonts during the caching process. | +| [LoadAtlasException](Velaptor.Content.Exceptions.LoadAtlasException.md 'Velaptor.Content.Exceptions.LoadAtlasException') | Thrown when there is an issue loading atlas data content. | +| [LoadContentException](Velaptor.Content.Exceptions.LoadContentException.md 'Velaptor.Content.Exceptions.LoadContentException') | Thrown when there is an issue loading content. | +| [LoadFontException](Velaptor.Content.Exceptions.LoadFontException.md 'Velaptor.Content.Exceptions.LoadFontException') | Thrown when there is an issue loading fonts. | +| [LoadSoundException](Velaptor.Content.Exceptions.LoadSoundException.md 'Velaptor.Content.Exceptions.LoadSoundException') | Thrown when there is an issue loading sounds. | +| [LoadTextureException](Velaptor.Content.Exceptions.LoadTextureException.md 'Velaptor.Content.Exceptions.LoadTextureException') | Thrown when there is an issue loading textures. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.Font.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.Font.md new file mode 100644 index 00000000..15d34316 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.Font.md @@ -0,0 +1,372 @@ +--- +title: Velaptor.Content.Fonts.Font +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Fonts](Velaptor.Content.Fonts.md 'Velaptor.Content.Fonts') + +#### Font Class + +Represents a font with a set size and style that can be used to render text to the screen. + +```csharp +public sealed class Font : +Velaptor.Content.Fonts.IFont, +Velaptor.Content.IContent +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ Font + +Implements [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont'), [IContent](Velaptor.Content.IContent.md 'Velaptor.Content.IContent') +## Properties + + + +### Atlas + +Gets the font atlas texture that contains all of the bitmap data for all available glyphs for the font. + +```csharp +public Velaptor.Content.ITexture Atlas { get; set; } +``` + +Implements [Atlas](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.Atlas 'Velaptor.Content.Fonts.IFont.Atlas') + +#### Property Value +[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + + + +### AvailableStylesForFamily + +Gets a list of all the available font styles for the current font [FamilyName](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.FamilyName 'Velaptor.Content.Fonts.IFont.FamilyName'). + +```csharp +public System.Collections.Generic.IEnumerable AvailableStylesForFamily { get; } +``` + +Implements [AvailableStylesForFamily](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.AvailableStylesForFamily 'Velaptor.Content.Fonts.IFont.AvailableStylesForFamily') + +#### Property Value +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[FontStyle](Velaptor.Content.Fonts.FontStyle.md 'Velaptor.Content.Fonts.FontStyle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') + + + +### CacheEnabled + +Gets or sets a value indicating whether or not to cache the measurements of the text. + +```csharp +public bool CacheEnabled { get; set; } +``` + +Implements [CacheEnabled](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.CacheEnabled 'Velaptor.Content.Fonts.IFont.CacheEnabled') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### FamilyName + +Gets the name of the font family. + +```csharp +public string FamilyName { get; } +``` + +Implements [FamilyName](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.FamilyName 'Velaptor.Content.Fonts.IFont.FamilyName') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### FilePath + +Gets the path to the content. + +```csharp +public string FilePath { get; } +``` + +Implements [FilePath](Velaptor.Content.IContent.md#Velaptor.Content.IContent.FilePath 'Velaptor.Content.IContent.FilePath') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### HasKerning + +Gets a value indicating whether or not the font has kerning for text rendering layout. + +```csharp +public bool HasKerning { get; } +``` + +Implements [HasKerning](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.HasKerning 'Velaptor.Content.Fonts.IFont.HasKerning') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### IsDefaultFont + +Gets a value indicating whether or not the font is a default font. + +```csharp +public bool IsDefaultFont { get; } +``` + +Implements [IsDefaultFont](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.IsDefaultFont 'Velaptor.Content.Fonts.IFont.IsDefaultFont') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### LineSpacing + +Gets the spacing between lines of text in pixels. + +```csharp +public float LineSpacing { get; set; } +``` + +Implements [LineSpacing](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.LineSpacing 'Velaptor.Content.Fonts.IFont.LineSpacing') + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### MaxCacheSize + +Gets or sets the maximum number of measurements to cache. + +```csharp +public int MaxCacheSize { get; set; } +``` + +Implements [MaxCacheSize](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.MaxCacheSize 'Velaptor.Content.Fonts.IFont.MaxCacheSize') + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Metrics + +Gets the list of metrics for all of the glyphs supported by the font. + +```csharp +public System.Collections.Generic.IReadOnlyCollection Metrics { get; } +``` + +Implements [Metrics](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.Metrics 'Velaptor.Content.Fonts.IFont.Metrics') + +#### Property Value +[System.Collections.Generic.IReadOnlyCollection<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1')[GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1') + + + +### Name + +Gets the name of the content. + +```csharp +public string Name { get; } +``` + +Implements [Name](Velaptor.Content.IContent.md#Velaptor.Content.IContent.Name 'Velaptor.Content.IContent.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Size + +Gets or sets the size of the font in points. + +```csharp +public uint Size { get; set; } +``` + +Implements [Size](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.Size 'Velaptor.Content.Fonts.IFont.Size') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Source + +Gets the source of where the font was loaded. + +```csharp +public Velaptor.Content.Fonts.FontSource Source { get; } +``` + +Implements [Source](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.Source 'Velaptor.Content.Fonts.IFont.Source') + +#### Property Value +[FontSource](Velaptor.Content.Fonts.FontSource.md 'Velaptor.Content.Fonts.FontSource') + + + +### Style + +Gets or sets the style of the font. + +```csharp +public Velaptor.Content.Fonts.FontStyle Style { get; set; } +``` + +Implements [Style](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.Style 'Velaptor.Content.Fonts.IFont.Style') + +#### Property Value +[FontStyle](Velaptor.Content.Fonts.FontStyle.md 'Velaptor.Content.Fonts.FontStyle') +## Methods + + + +### GetCharacterBounds(string, Vector2) + +Returns the bounds of each character in the given [text](Velaptor.Content.Fonts.Font.md#Velaptor.Content.Fonts.Font.GetCharacterBounds(string,System.Numerics.Vector2).text 'Velaptor.Content.Fonts.Font.GetCharacterBounds(string, System.Numerics.Vector2).text') based on the +given [textPos](Velaptor.Content.Fonts.Font.md#Velaptor.Content.Fonts.Font.GetCharacterBounds(string,System.Numerics.Vector2).textPos 'Velaptor.Content.Fonts.Font.GetCharacterBounds(string, System.Numerics.Vector2).textPos'). + +```csharp +public System.Collections.Generic.IEnumerable<(char character,System.Drawing.RectangleF bounds)> GetCharacterBounds(string text, System.Numerics.Vector2 textPos); +``` +#### Parameters + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to get the bounds data. + + + +`textPos` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The position of the text as a whole. + +Implements [GetCharacterBounds(string, Vector2)](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.GetCharacterBounds(string,System.Numerics.Vector2) 'Velaptor.Content.Fonts.IFont.GetCharacterBounds(string, System.Numerics.Vector2)') + +#### Returns +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[<](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Char](https://docs.microsoft.com/en-us/dotnet/api/System.Char 'System.Char')[,](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF')[>](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') +The bounds for each character. + + + +### GetCharacterBounds(StringBuilder, Vector2) + +Returns the bounds of each character in the given [text](Velaptor.Content.Fonts.Font.md#Velaptor.Content.Fonts.Font.GetCharacterBounds(System.Text.StringBuilder,System.Numerics.Vector2).text 'Velaptor.Content.Fonts.Font.GetCharacterBounds(System.Text.StringBuilder, System.Numerics.Vector2).text') based on the +given [textPos](Velaptor.Content.Fonts.Font.md#Velaptor.Content.Fonts.Font.GetCharacterBounds(System.Text.StringBuilder,System.Numerics.Vector2).textPos 'Velaptor.Content.Fonts.Font.GetCharacterBounds(System.Text.StringBuilder, System.Numerics.Vector2).textPos'). + +```csharp +public System.Collections.Generic.IEnumerable<(char character,System.Drawing.RectangleF bounds)> GetCharacterBounds(System.Text.StringBuilder text, System.Numerics.Vector2 textPos); +``` +#### Parameters + + + +`text` [System.Text.StringBuilder](https://docs.microsoft.com/en-us/dotnet/api/System.Text.StringBuilder 'System.Text.StringBuilder') + +The text to get the bounds data. + + + +`textPos` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The position of the text as a whole. + +Implements [GetCharacterBounds(StringBuilder, Vector2)](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.GetCharacterBounds(System.Text.StringBuilder,System.Numerics.Vector2) 'Velaptor.Content.Fonts.IFont.GetCharacterBounds(System.Text.StringBuilder, System.Numerics.Vector2)') + +#### Returns +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[<](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Char](https://docs.microsoft.com/en-us/dotnet/api/System.Char 'System.Char')[,](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF')[>](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') +The bounds for each character. + + + +### GetKerning(uint, uint) + +Gets the kerning value between two glyphs. + +```csharp +public float GetKerning(uint leftGlyphIndex, uint rightGlyphIndex); +``` +#### Parameters + + + +`leftGlyphIndex` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The character index of the glyph to the left of the right glyph. + + + +`rightGlyphIndex` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The character index of the glyph to the right of the left glyph. + +Implements [GetKerning(uint, uint)](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.GetKerning(uint,uint) 'Velaptor.Content.Fonts.IFont.GetKerning(uint, uint)') + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +The kerning (horizontal spacing) between the glyphs. + +#### Remarks +Refer to the URL below for more info. + +https://freetype.org/freetype2/docs/glyphs/glyphs-4.html#section-1. + + + +### Measure(string) + +Measures the width and height bounds of the given [text](Velaptor.Content.Fonts.Font.md#Velaptor.Content.Fonts.Font.Measure(string).text 'Velaptor.Content.Fonts.Font.Measure(string).text'). + +```csharp +public System.Drawing.SizeF Measure(string text); +``` +#### Parameters + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to measure. + +Implements [Measure(string)](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.Measure(string) 'Velaptor.Content.Fonts.IFont.Measure(string)') + +#### Returns +[System.Drawing.SizeF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.SizeF 'System.Drawing.SizeF') +The width and height of the text in pixels. + + + +### ToGlyphMetrics(string) + +Returns all of the glyph metrics for the given text. + +```csharp +public Velaptor.Graphics.GlyphMetrics[] ToGlyphMetrics(string text); +``` +#### Parameters + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to convert to glyph metrics. + +Implements [ToGlyphMetrics(string)](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.ToGlyphMetrics(string) 'Velaptor.Content.Fonts.IFont.ToGlyphMetrics(string)') + +#### Returns +[GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') +The list of glyph metrics of the given [text](Velaptor.Content.Fonts.Font.md#Velaptor.Content.Fonts.Font.ToGlyphMetrics(string).text 'Velaptor.Content.Fonts.Font.ToGlyphMetrics(string).text'). \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontLoader.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontLoader.md new file mode 100644 index 00000000..df8d0b21 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontLoader.md @@ -0,0 +1,116 @@ +--- +title: Velaptor.Content.Fonts.FontLoader +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Fonts](Velaptor.Content.Fonts.md 'Velaptor.Content.Fonts') + +#### FontLoader Class + +Loads font content for rendering text. + +```csharp +public sealed class FontLoader : +Velaptor.Content.ILoader +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ FontLoader + +Implements [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') +## Constructors + + + +### FontLoader() Constructor + +Initializes a new instance of the [FontLoader](Velaptor.Content.Fonts.FontLoader.md 'Velaptor.Content.Fonts.FontLoader') class. + +```csharp +public FontLoader(); +``` +## Methods + + + +### Load(string) + +Loads font content from the application's content directory or directly using a full file path. + +```csharp +public Velaptor.Content.Fonts.IFont Load(string contentPathOrName); +``` +#### Parameters + + + +`contentPathOrName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name or full file path to the font with metadata. + +Implements [Load(string)](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.Load(string) 'Velaptor.Content.ILoader.Load(string)') + +#### Returns +[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') +The loaded font. + +#### Exceptions + +[System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') +Occurs when the [contentPathOrName](Velaptor.Content.Fonts.FontLoader.md#Velaptor.Content.Fonts.FontLoader.Load(string).contentPathOrName 'Velaptor.Content.Fonts.FontLoader.Load(string).contentPathOrName') argument is null or empty. + +[CachingMetaDataException](Velaptor.Content.Exceptions.CachingMetaDataException.md 'Velaptor.Content.Exceptions.CachingMetaDataException') +Occurs if the metadata is invalid. + +[System.IO.FileNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileNotFoundException 'System.IO.FileNotFoundException') +Occurs if the font file does not exist. + +### Example + +```csharp +// Valid Example 1 +ContentLoader.Load("my-font|size:12"); +
+// Valid Example 2 +ContentLoader.Load("my-font"); +
+// Valid Example 3 +ContentLoader.Load("my-font.ttf"); +
+// Valid Example 4 +ContentLoader.Load(@"C:\fonts\my-font.ttf|size:12"); +
+// Invalid Example 1 +ContentLoader.Load("my-font|size:12"); +
+// Invalid Example 2 +ContentLoader.Load("my-font|size:12"); +
+// Invalid Example 3 +ContentLoader.Load("my-font|size12"); +``` + +#### Remarks +If a path is used, it must be a fully qualified file path. + +Directory paths are not valid. + +If no metadata is provided, then a default font size of 12 will be used. + + + +### Unload(string) + +Unloads the data with the given [contentPathOrName](Velaptor.Content.Fonts.FontLoader.md#Velaptor.Content.Fonts.FontLoader.Unload(string).contentPathOrName 'Velaptor.Content.Fonts.FontLoader.Unload(string).contentPathOrName'). + +```csharp +public void Unload(string contentPathOrName); +``` +#### Parameters + + + +`contentPathOrName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the content item to unload. + +Implements [Unload(string)](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.Unload(string) 'Velaptor.Content.ILoader.Unload(string)') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontSource.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontSource.md new file mode 100644 index 00000000..22599673 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontSource.md @@ -0,0 +1,40 @@ +--- +title: Velaptor.Content.Fonts.FontSource +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Fonts](Velaptor.Content.Fonts.md 'Velaptor.Content.Fonts') + +## FontSource Enum + +Represents the source of where a font was loaded. + +```csharp +public enum FontSource +``` +#### Fields + + + +`AppContent` 1 + +Loaded from the application's content directory. + + + +`System` 2 + +Loaded from the system. + + + +`Unknown` 0 + +Loaded from another location other then the system or application's font content directory. + +#### Remarks +When loading fonts, the font that is attempting to be loaded will be +checked for its existence in the application's content directory first. +If the font does not exist there, then the font will be checked for +its existence in the system. If the font does not exist in the application's +content directory or the system, then an exception will be thrown. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontStyle.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontStyle.md new file mode 100644 index 00000000..9de93e09 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.FontStyle.md @@ -0,0 +1,33 @@ +--- +title: Velaptor.Content.Fonts.FontStyle +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Fonts](Velaptor.Content.Fonts.md 'Velaptor.Content.Fonts') + +## FontStyle Enum + +The kind of font styles. + +```csharp +public enum FontStyle +``` +#### Fields + + + +`Bold` 2 + +Bold font style. + + + +`Italic` 1 + +Italic font style. + + + +`Regular` 0 + +Regular font style. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.IFont.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.IFont.md new file mode 100644 index 00000000..bf360374 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.IFont.md @@ -0,0 +1,306 @@ +--- +title: Velaptor.Content.Fonts.IFont +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content.Fonts](Velaptor.Content.Fonts.md 'Velaptor.Content.Fonts') + +#### IFont Interface + +The font to use when rendering text to the screen. + +```csharp +public interface IFont : +Velaptor.Content.IContent +``` + +Derived +↳ [Font](Velaptor.Content.Fonts.Font.md 'Velaptor.Content.Fonts.Font') + +Implements [IContent](Velaptor.Content.IContent.md 'Velaptor.Content.IContent') +## Properties + + + +### Atlas + +Gets the font atlas texture that contains all of the bitmap data for all available glyphs for the font. + +```csharp +Velaptor.Content.ITexture Atlas { get; } +``` + +#### Property Value +[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + + + +### AvailableStylesForFamily + +Gets a list of all the available font styles for the current font [FamilyName](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.FamilyName 'Velaptor.Content.Fonts.IFont.FamilyName'). + +```csharp +System.Collections.Generic.IEnumerable AvailableStylesForFamily { get; } +``` + +#### Property Value +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[FontStyle](Velaptor.Content.Fonts.FontStyle.md 'Velaptor.Content.Fonts.FontStyle')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') + + + +### CacheEnabled + +Gets or sets a value indicating whether or not to cache the measurements of the text. + +```csharp +bool CacheEnabled { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### FamilyName + +Gets the name of the font family. + +```csharp +string FamilyName { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### HasKerning + +Gets a value indicating whether or not the font has kerning for text rendering layout. + +```csharp +bool HasKerning { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### IsDefaultFont + +Gets a value indicating whether or not the font is a default font. + +```csharp +bool IsDefaultFont { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### LineSpacing + +Gets the spacing between lines of text in pixels. + +```csharp +float LineSpacing { get; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### MaxCacheSize + +Gets or sets the maximum number of measurements to cache. + +```csharp +int MaxCacheSize { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Metrics + +Gets the list of metrics for all of the glyphs supported by the font. + +```csharp +System.Collections.Generic.IReadOnlyCollection Metrics { get; } +``` + +#### Property Value +[System.Collections.Generic.IReadOnlyCollection<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1')[GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1') + + + +### Size + +Gets or sets the size of the font in points. + +```csharp +uint Size { get; set; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Source + +Gets the source of where the font was loaded. + +```csharp +Velaptor.Content.Fonts.FontSource Source { get; } +``` + +#### Property Value +[FontSource](Velaptor.Content.Fonts.FontSource.md 'Velaptor.Content.Fonts.FontSource') + + + +### Style + +Gets or sets the style of the font. + +```csharp +Velaptor.Content.Fonts.FontStyle Style { get; set; } +``` + +#### Property Value +[FontStyle](Velaptor.Content.Fonts.FontStyle.md 'Velaptor.Content.Fonts.FontStyle') +## Methods + + + +### GetCharacterBounds(string, Vector2) + +Returns the bounds of each character in the given [text](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.GetCharacterBounds(string,System.Numerics.Vector2).text 'Velaptor.Content.Fonts.IFont.GetCharacterBounds(string, System.Numerics.Vector2).text') based on the +given [textPos](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.GetCharacterBounds(string,System.Numerics.Vector2).textPos 'Velaptor.Content.Fonts.IFont.GetCharacterBounds(string, System.Numerics.Vector2).textPos'). + +```csharp +System.Collections.Generic.IEnumerable<(char character,System.Drawing.RectangleF bounds)> GetCharacterBounds(string text, System.Numerics.Vector2 textPos); +``` +#### Parameters + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to get the bounds data. + + + +`textPos` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The position of the text as a whole. + +#### Returns +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[<](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Char](https://docs.microsoft.com/en-us/dotnet/api/System.Char 'System.Char')[,](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF')[>](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') +The bounds for each character. + + + +### GetCharacterBounds(StringBuilder, Vector2) + +Returns the bounds of each character in the given [text](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.GetCharacterBounds(System.Text.StringBuilder,System.Numerics.Vector2).text 'Velaptor.Content.Fonts.IFont.GetCharacterBounds(System.Text.StringBuilder, System.Numerics.Vector2).text') based on the +given [textPos](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.GetCharacterBounds(System.Text.StringBuilder,System.Numerics.Vector2).textPos 'Velaptor.Content.Fonts.IFont.GetCharacterBounds(System.Text.StringBuilder, System.Numerics.Vector2).textPos'). + +```csharp +System.Collections.Generic.IEnumerable<(char character,System.Drawing.RectangleF bounds)> GetCharacterBounds(System.Text.StringBuilder text, System.Numerics.Vector2 textPos); +``` +#### Parameters + + + +`text` [System.Text.StringBuilder](https://docs.microsoft.com/en-us/dotnet/api/System.Text.StringBuilder 'System.Text.StringBuilder') + +The text to get the bounds data. + + + +`textPos` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The position of the text as a whole. + +#### Returns +[System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[<](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Char](https://docs.microsoft.com/en-us/dotnet/api/System.Char 'System.Char')[,](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF')[>](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') +The bounds for each character. + + + +### GetKerning(uint, uint) + +Gets the kerning between two glyphs using the given [leftGlyphIndex](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.GetKerning(uint,uint).leftGlyphIndex 'Velaptor.Content.Fonts.IFont.GetKerning(uint, uint).leftGlyphIndex') and [rightGlyphIndex](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.GetKerning(uint,uint).rightGlyphIndex 'Velaptor.Content.Fonts.IFont.GetKerning(uint, uint).rightGlyphIndex'). + +```csharp +float GetKerning(uint leftGlyphIndex, uint rightGlyphIndex); +``` +#### Parameters + + + +`leftGlyphIndex` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The index of the left glyph. + + + +`rightGlyphIndex` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The index of the right glyph. + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +The kerning result between the glyphs. + +#### Remarks +Refer to https://freetype.org/freetype2/docs/glyphs/glyphs-4.html for more info. + + + +### Measure(string) + +Measures the width and height bounds of the given [text](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.Measure(string).text 'Velaptor.Content.Fonts.IFont.Measure(string).text'). + +```csharp +System.Drawing.SizeF Measure(string text); +``` +#### Parameters + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to measure. + +#### Returns +[System.Drawing.SizeF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.SizeF 'System.Drawing.SizeF') +The width and height of the text in pixels. + + + +### ToGlyphMetrics(string) + +Gets the glyph metrics using the given [text](Velaptor.Content.Fonts.IFont.md#Velaptor.Content.Fonts.IFont.ToGlyphMetrics(string).text 'Velaptor.Content.Fonts.IFont.ToGlyphMetrics(string).text'). + +```csharp +Velaptor.Graphics.GlyphMetrics[] ToGlyphMetrics(string text); +``` +#### Parameters + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to get the metrics for. + +#### Returns +[GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') +The metrics of each individual glyph/character. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.md new file mode 100644 index 00000000..2161e6cd --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Fonts.md @@ -0,0 +1,21 @@ +--- +title: Velaptor.Content.Fonts +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Content.Fonts Namespace + +| Classes | | +| :--- | :--- | +| [Font](Velaptor.Content.Fonts.Font.md 'Velaptor.Content.Fonts.Font') | Represents a font with a set size and style that can be used to render text to the screen. | +| [FontLoader](Velaptor.Content.Fonts.FontLoader.md 'Velaptor.Content.Fonts.FontLoader') | Loads font content for rendering text. | + +| Interfaces | | +| :--- | :--- | +| [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') | The font to use when rendering text to the screen. | + +| Enums | | +| :--- | :--- | +| [FontSource](Velaptor.Content.Fonts.FontSource.md 'Velaptor.Content.Fonts.FontSource') | Represents the source of where a font was loaded. | +| [FontStyle](Velaptor.Content.Fonts.FontStyle.md 'Velaptor.Content.Fonts.FontStyle') | The kind of font styles. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IAtlasData.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IAtlasData.md new file mode 100644 index 00000000..d3786170 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IAtlasData.md @@ -0,0 +1,128 @@ +--- +title: Velaptor.Content.IAtlasData +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### IAtlasData Interface + +Holds data for a texture atlas. + +```csharp +public interface IAtlasData : +Velaptor.Content.IContent +``` + +Derived +↳ [AtlasData](Velaptor.Content.AtlasData.md 'Velaptor.Content.AtlasData') + +Implements [IContent](Velaptor.Content.IContent.md 'Velaptor.Content.IContent') +## Properties + + + +### AtlasDataFilePath + +Gets the file path to the atlas data. + +```csharp +string AtlasDataFilePath { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Height + +Gets the height of the entire texture atlas texture. + +```csharp +uint Height { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### SubTextureNames + +Gets the list of frame names. + +```csharp +System.Collections.Generic.IReadOnlyCollection SubTextureNames { get; } +``` + +#### Property Value +[System.Collections.Generic.IReadOnlyCollection<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1') + + + +### Texture + +Gets the the texture of the atlas. + +```csharp +Velaptor.Content.ITexture Texture { get; } +``` + +#### Property Value +[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + + + +### this[int] + +The iterator for the atlas sub texture data. + +```csharp +Velaptor.Graphics.AtlasSubTextureData this[int index] { get; } +``` +#### Parameters + + + +`index` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The index of the item to retrieve. + +#### Property Value +[AtlasSubTextureData](Velaptor.Graphics.AtlasSubTextureData.md 'Velaptor.Graphics.AtlasSubTextureData') + + + +### Width + +Gets the width of the entire texture atlas texture. + +```csharp +uint Width { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') +## Methods + + + +### GetFrames(string) + +Gets the all of the frames that have the given sub texture id. + +```csharp +Velaptor.Graphics.AtlasSubTextureData[] GetFrames(string subTextureId); +``` +#### Parameters + + + +`subTextureId` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The sub texture ID of the frames to return. + +#### Returns +[AtlasSubTextureData](Velaptor.Graphics.AtlasSubTextureData.md 'Velaptor.Graphics.AtlasSubTextureData')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') +The list of frame rectangles. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContent.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContent.md new file mode 100644 index 00000000..da7a3000 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContent.md @@ -0,0 +1,51 @@ +--- +title: Velaptor.Content.IContent +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### IContent Interface + +Represents loadable content data. + +```csharp +public interface IContent +``` + +Derived +↳ [AtlasData](Velaptor.Content.AtlasData.md 'Velaptor.Content.AtlasData') +↳ [Font](Velaptor.Content.Fonts.Font.md 'Velaptor.Content.Fonts.Font') +↳ [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') +↳ [IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData') +↳ [ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound') +↳ [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') +↳ [Sound](Velaptor.Content.Sound.md 'Velaptor.Content.Sound') +↳ [Texture](Velaptor.Content.Texture.md 'Velaptor.Content.Texture') +## Properties + + + +### FilePath + +Gets the path to the content. + +```csharp +string FilePath { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Name + +Gets the name of the content. + +```csharp +string Name { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContentLoadable.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContentLoadable.md new file mode 100644 index 00000000..f613567d --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContentLoadable.md @@ -0,0 +1,53 @@ +--- +title: Velaptor.Content.IContentLoadable +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### IContentLoadable Interface + +Provides the ability to load content. + +```csharp +public interface IContentLoadable +``` + +Derived +↳ [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase') +↳ [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') +## Properties + + + +### IsLoaded + +Gets a value indicating whether or not the content for an object is loaded. + +```csharp +bool IsLoaded { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +## Methods + + + +### LoadContent() + +Loads the content for an object. + +```csharp +void LoadContent(); +``` + + + +### UnloadContent() + +Unloads the content for an object. + +```csharp +void UnloadContent(); +``` \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContentPathResolver.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContentPathResolver.md new file mode 100644 index 00000000..e885b2d9 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.IContentPathResolver.md @@ -0,0 +1,85 @@ +--- +title: Velaptor.Content.IContentPathResolver +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### IContentPathResolver Interface + +Resolves file paths. + +```csharp +public interface IContentPathResolver +``` +## Properties + + + +### ContentDirectoryName + +Gets the name of the content directory. + +```csharp +string ContentDirectoryName { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +#### Remarks + +This directory is not a path. It is just a name and is always located +as a child directory of the [RootDirectoryPath](Velaptor.Content.IContentPathResolver.md#Velaptor.Content.IContentPathResolver.RootDirectoryPath 'Velaptor.Content.IContentPathResolver.RootDirectoryPath'). + +If the value is a file path, the file name will be stripped and the +deepest child directory name will be used. + + + +### RootDirectoryPath + +Gets the root directory of the content. + +```csharp +string RootDirectoryPath { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +## Methods + + + +### ResolveDirPath() + +Resolves the full directory path to some content. + +```csharp +string ResolveDirPath(); +``` + +#### Returns +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The directory only path to some content. + + + +### ResolveFilePath(string) + +Resolves the full file path to a content item that matches the given [contentName](Velaptor.Content.IContentPathResolver.md#Velaptor.Content.IContentPathResolver.ResolveFilePath(string).contentName 'Velaptor.Content.IContentPathResolver.ResolveFilePath(string).contentName'). + +```csharp +string ResolveFilePath(string contentName); +``` +#### Parameters + + + +`contentName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the content item with or without the file extension. + +#### Returns +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The [RootDirectoryPath](Velaptor.Content.IContentPathResolver.md#Velaptor.Content.IContentPathResolver.RootDirectoryPath 'Velaptor.Content.IContentPathResolver.RootDirectoryPath'), content file name, and the [ContentDirectoryName](Velaptor.Content.IContentPathResolver.md#Velaptor.Content.IContentPathResolver.ContentDirectoryName 'Velaptor.Content.IContentPathResolver.ContentDirectoryName') combined. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ILoader_T_.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ILoader_T_.md new file mode 100644 index 00000000..c2aa9d2f --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ILoader_T_.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Content.ILoader +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### ILoader<T> Interface + +Loads data of type [T](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.T 'Velaptor.Content.ILoader.T'). + +```csharp +public interface ILoader + where T : Velaptor.Content.IContent +``` +#### Type parameters + + + +`T` + +The type of data to load. + +Derived +↳ [AtlasLoader](Velaptor.Content.AtlasLoader.md 'Velaptor.Content.AtlasLoader') +↳ [FontLoader](Velaptor.Content.Fonts.FontLoader.md 'Velaptor.Content.Fonts.FontLoader') +↳ [SoundLoader](Velaptor.Content.SoundLoader.md 'Velaptor.Content.SoundLoader') +↳ [TextureLoader](Velaptor.Content.TextureLoader.md 'Velaptor.Content.TextureLoader') +## Methods + + + +### Load(string) + +Loads data with the given [contentPathOrName](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.Load(string).contentPathOrName 'Velaptor.Content.ILoader.Load(string).contentPathOrName'). + +```csharp +T Load(string contentPathOrName); +``` +#### Parameters + + + +`contentPathOrName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the content of the data to load. + +#### Returns +[T](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.T 'Velaptor.Content.ILoader.T') +The data loaded from disk. + + + +### Unload(string) + +Unloads the data with the given [contentPathOrName](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.Unload(string).contentPathOrName 'Velaptor.Content.ILoader.Unload(string).contentPathOrName'). + +```csharp +void Unload(string contentPathOrName); +``` +#### Parameters + + + +`contentPathOrName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the content item to unload. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ISound.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ISound.md new file mode 100644 index 00000000..e43f347f --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ISound.md @@ -0,0 +1,66 @@ +--- +title: Velaptor.Content.ISound +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### ISound Interface + +A single sound that can be played, paused etc. + +```csharp +public interface ISound : +CASL.ISound, +System.IDisposable, +Velaptor.Content.IContent +``` + +Derived +↳ [Sound](Velaptor.Content.Sound.md 'Velaptor.Content.Sound') + +Implements [CASL.ISound](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound 'CASL.ISound'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [IContent](Velaptor.Content.IContent.md 'Velaptor.Content.IContent') +## Properties + + + +### FilePath + +Gets the fully qualified path to the content file. + +```csharp +string FilePath { get; } +``` + +Implements [FilePath](Velaptor.Content.IContent.md#Velaptor.Content.IContent.FilePath 'Velaptor.Content.IContent.FilePath'), [FilePath](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.FilePath 'CASL.ISound.FilePath') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Id + +Gets the unique ID of the sound. + +```csharp +uint Id { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Name + +Gets the name of the content. + +```csharp +string Name { get; } +``` + +Implements [Name](Velaptor.Content.IContent.md#Velaptor.Content.IContent.Name 'Velaptor.Content.IContent.Name'), [Name](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.Name 'CASL.ISound.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ITexture.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ITexture.md new file mode 100644 index 00000000..81c43ad8 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.ITexture.md @@ -0,0 +1,60 @@ +--- +title: Velaptor.Content.ITexture +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### ITexture Interface + +The texture to render to a screen. + +```csharp +public interface ITexture : +Velaptor.Content.IContent +``` + +Derived +↳ [Texture](Velaptor.Content.Texture.md 'Velaptor.Content.Texture') + +Implements [IContent](Velaptor.Content.IContent.md 'Velaptor.Content.IContent') +## Properties + + + +### Height + +Gets the height of the texture. + +```csharp +uint Height { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Id + +Gets the ID of the texture. + +```csharp +uint Id { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Width + +Gets the width of the texture. + +```csharp +uint Width { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Sound.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Sound.md new file mode 100644 index 00000000..c195a9cd --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Sound.md @@ -0,0 +1,309 @@ +--- +title: Velaptor.Content.Sound +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### Sound Class + +A single sound that can be played, paused etc. + +```csharp +public sealed class Sound : +Velaptor.Content.ISound, +CASL.ISound, +System.IDisposable, +Velaptor.Content.IContent +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ Sound + +Implements [ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound'), [CASL.ISound](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound 'CASL.ISound'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable'), [IContent](Velaptor.Content.IContent.md 'Velaptor.Content.IContent') +## Constructors + + + +### Sound(string) Constructor + +Initializes a new instance of the [Sound](Velaptor.Content.Sound.md 'Velaptor.Content.Sound') class. + +```csharp +public Sound(string filePath); +``` +#### Parameters + + + +`filePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The path to the sound file. +## Properties + + + +### FilePath + +Gets the fully qualified path to the sound file. + +```csharp +public string FilePath { get; } +``` + +Implements [FilePath](Velaptor.Content.ISound.md#Velaptor.Content.ISound.FilePath 'Velaptor.Content.ISound.FilePath'), [FilePath](Velaptor.Content.IContent.md#Velaptor.Content.IContent.FilePath 'Velaptor.Content.IContent.FilePath'), [FilePath](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.FilePath 'CASL.ISound.FilePath') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Id + +Gets the unique ID of the sound. + +```csharp +public uint Id { get; set; } +``` + +Implements [Id](Velaptor.Content.ISound.md#Velaptor.Content.ISound.Id 'Velaptor.Content.ISound.Id') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### IsLooping + +Gets or sets a value indicating whether or not the sound loops back to the beginning once the end has been reached. + +```csharp +public bool IsLooping { get; set; } +``` + +Implements [IsLooping](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.IsLooping 'CASL.ISound.IsLooping') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Length + +Gets the length of the sound. + +```csharp +public CASL.SoundTime Length { get; } +``` + +Implements [Length](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.Length 'CASL.ISound.Length') + +#### Property Value +[CASL.SoundTime](https://docs.microsoft.com/en-us/dotnet/api/CASL.SoundTime 'CASL.SoundTime') + + + +### Name + +Gets the name of the sound. + +```csharp +public string Name { get; } +``` + +Implements [Name](Velaptor.Content.ISound.md#Velaptor.Content.ISound.Name 'Velaptor.Content.ISound.Name'), [Name](Velaptor.Content.IContent.md#Velaptor.Content.IContent.Name 'Velaptor.Content.IContent.Name'), [Name](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.Name 'CASL.ISound.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### PlaySpeed + +Gets or sets the play speed to the given value. + +```csharp +public float PlaySpeed { get; set; } +``` + +Implements [PlaySpeed](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.PlaySpeed 'CASL.ISound.PlaySpeed') + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +The valid range of value is between 0.25 and 2.0 +with a value less than 0.25 defaulting to 0.25 and +with a value greater than 2.0 defaulting to 2.0. + + + +### Position + +Gets the current time position of the sound. + +```csharp +public CASL.SoundTime Position { get; } +``` + +Implements [Position](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.Position 'CASL.ISound.Position') + +#### Property Value +[CASL.SoundTime](https://docs.microsoft.com/en-us/dotnet/api/CASL.SoundTime 'CASL.SoundTime') + + + +### State + +Gets the state of the sound. + +```csharp +public CASL.SoundState State { get; } +``` + +Implements [State](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.State 'CASL.ISound.State') + +#### Property Value +[CASL.SoundState](https://docs.microsoft.com/en-us/dotnet/api/CASL.SoundState 'CASL.SoundState') + + + +### Volume + +Gets or sets the volume of the sound. + +```csharp +public float Volume { get; set; } +``` + +Implements [Volume](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.Volume 'CASL.ISound.Volume') + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +The only valid value accepted is 0-100. If a value outside of +this range is used, it will be set within that range. +## Methods + + + +### Dispose() + + + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') + + + +### FastForward(float) + +Advances the sound forward by the given amount of [seconds](Velaptor.Content.Sound.md#Velaptor.Content.Sound.FastForward(float).seconds 'Velaptor.Content.Sound.FastForward(float).seconds'). + +```csharp +public void FastForward(float seconds); +``` +#### Parameters + + + +`seconds` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The amount of seconds to fast forward the sound. + +Implements [FastForward(float)](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.FastForward#CASL_ISound_FastForward_System_Single_ 'CASL.ISound.FastForward(System.Single)') + + + +### Pause() + +Pauses the sound. + +```csharp +public void Pause(); +``` + +Implements [Pause()](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.Pause 'CASL.ISound.Pause') + + + +### Play() + +Plays the sound. + +```csharp +public void Play(); +``` + +Implements [Play()](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.Play 'CASL.ISound.Play') + + + +### Reset() + +Resets the sound. + +```csharp +public void Reset(); +``` + +Implements [Reset()](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.Reset 'CASL.ISound.Reset') + +#### Remarks +This will stop the sound and set the time position back to the beginning. + + + +### Rewind(float) + +Rewinds the sound by the given amount of [seconds](Velaptor.Content.Sound.md#Velaptor.Content.Sound.Rewind(float).seconds 'Velaptor.Content.Sound.Rewind(float).seconds'). + +```csharp +public void Rewind(float seconds); +``` +#### Parameters + + + +`seconds` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The amount of seconds to rewind the sound. + +Implements [Rewind(float)](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.Rewind#CASL_ISound_Rewind_System_Single_ 'CASL.ISound.Rewind(System.Single)') + + + +### SetTimePosition(float) + +Sets the time position of the sound to the given value. + +```csharp +public void SetTimePosition(float seconds); +``` +#### Parameters + + + +`seconds` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The time position in seconds of where to set the sound. + +Implements [SetTimePosition(float)](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.SetTimePosition#CASL_ISound_SetTimePosition_System_Single_ 'CASL.ISound.SetTimePosition(System.Single)') + + + +### Stop() + +Stops the sound. + +```csharp +public void Stop(); +``` + +Implements [Stop()](https://docs.microsoft.com/en-us/dotnet/api/CASL.ISound.Stop 'CASL.ISound.Stop') + +#### Remarks +This will set the time position back to the beginning. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.SoundLoader.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.SoundLoader.md new file mode 100644 index 00000000..31ee96a6 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.SoundLoader.md @@ -0,0 +1,99 @@ +--- +title: Velaptor.Content.SoundLoader +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### SoundLoader Class + +Loads sound content. + +```csharp +public sealed class SoundLoader : +Velaptor.Content.ILoader +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ SoundLoader + +Implements [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') +## Constructors + + + +### SoundLoader() Constructor + +Initializes a new instance of the [SoundLoader](Velaptor.Content.SoundLoader.md 'Velaptor.Content.SoundLoader') class. + +```csharp +public SoundLoader(); +``` +## Methods + + + +### Load(string) + +Loads a sound with the given name. + +```csharp +public Velaptor.Content.ISound Load(string contentPathOrName); +``` +#### Parameters + + + +`contentPathOrName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The full file path or name of the sound to load. + +Implements [Load(string)](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.Load(string) 'Velaptor.Content.ILoader.Load(string)') + +#### Returns +[ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound') +The loaded sound. + +#### Exceptions + +[System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') +Thrown if the [contentPathOrName](Velaptor.Content.SoundLoader.md#Velaptor.Content.SoundLoader.Load(string).contentPathOrName 'Velaptor.Content.SoundLoader.Load(string).contentPathOrName') is null or empty. + +[LoadTextureException](Velaptor.Content.Exceptions.LoadTextureException.md 'Velaptor.Content.Exceptions.LoadTextureException') +Thrown if the resulting texture content file path is invalid. + +[System.IO.FileNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileNotFoundException 'System.IO.FileNotFoundException') +Thrown if the texture file does not exist. + +[System.IO.IOException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.IOException 'System.IO.IOException') +The directory specified a file or the network name is not known. + +[System.UnauthorizedAccessException](https://docs.microsoft.com/en-us/dotnet/api/System.UnauthorizedAccessException 'System.UnauthorizedAccessException') +The caller does not have the required permissions. + +[System.IO.PathTooLongException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.PathTooLongException 'System.IO.PathTooLongException') +The specified path, file name, or both exceed the system-defined maximum length. + +[System.IO.DirectoryNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.DirectoryNotFoundException 'System.IO.DirectoryNotFoundException') +The specified path is invalid (for example, it is on an unmapped drive). + +[System.NotSupportedException](https://docs.microsoft.com/en-us/dotnet/api/System.NotSupportedException 'System.NotSupportedException') +The path contains a colon character `:` that is not part of a drive label. + + + +### Unload(string) + +Unloads the data with the given [contentPathOrName](Velaptor.Content.SoundLoader.md#Velaptor.Content.SoundLoader.Unload(string).contentPathOrName 'Velaptor.Content.SoundLoader.Unload(string).contentPathOrName'). + +```csharp +public void Unload(string contentPathOrName); +``` +#### Parameters + + + +`contentPathOrName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the content item to unload. + +Implements [Unload(string)](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.Unload(string) 'Velaptor.Content.ILoader.Unload(string)') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Texture.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Texture.md new file mode 100644 index 00000000..bdd47b9e --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.Texture.md @@ -0,0 +1,153 @@ +--- +title: Velaptor.Content.Texture +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### Texture Class + +The texture to render to a screen. + +```csharp +public sealed class Texture : +Velaptor.Content.ITexture, +Velaptor.Content.IContent +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ Texture + +Implements [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture'), [IContent](Velaptor.Content.IContent.md 'Velaptor.Content.IContent') +## Constructors + + + +### Texture(string, string) Constructor + +Initializes a new instance of the [Texture](Velaptor.Content.Texture.md 'Velaptor.Content.Texture') class. + +```csharp +public Texture(string name, string filePath); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the texture. + + + +`filePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The file path to the image file. + +#### Exceptions + +[System.IO.FileNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileNotFoundException 'System.IO.FileNotFoundException') +Thrown if the [filePath](Velaptor.Content.Texture.md#Velaptor.Content.Texture.Texture(string,string).filePath 'Velaptor.Content.Texture.Texture(string, string).filePath') is not found. + + + +### Texture(string, ImageData) Constructor + +Initializes a new instance of the [Texture](Velaptor.Content.Texture.md 'Velaptor.Content.Texture') class. + +```csharp +public Texture(string name, Velaptor.Graphics.ImageData imageData); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the texture. + + + +`imageData` [ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData') + +The image data of the texture. + +#### Exceptions + +[System.ArgumentException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentException 'System.ArgumentException') +Thrown if the [imageData](Velaptor.Content.Texture.md#Velaptor.Content.Texture.Texture(string,Velaptor.Graphics.ImageData).imageData 'Velaptor.Content.Texture.Texture(string, Velaptor.Graphics.ImageData).imageData') is empty. +## Properties + + + +### FilePath + +Gets the path to the content. + +```csharp +public string FilePath { get; } +``` + +Implements [FilePath](Velaptor.Content.IContent.md#Velaptor.Content.IContent.FilePath 'Velaptor.Content.IContent.FilePath') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Height + +Gets the height of the texture. + +```csharp +public uint Height { get; set; } +``` + +Implements [Height](Velaptor.Content.ITexture.md#Velaptor.Content.ITexture.Height 'Velaptor.Content.ITexture.Height') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Id + +Gets the ID of the texture. + +```csharp +public uint Id { get; set; } +``` + +Implements [Id](Velaptor.Content.ITexture.md#Velaptor.Content.ITexture.Id 'Velaptor.Content.ITexture.Id') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Name + +Gets the name of the content. + +```csharp +public string Name { get; set; } +``` + +Implements [Name](Velaptor.Content.IContent.md#Velaptor.Content.IContent.Name 'Velaptor.Content.IContent.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Width + +Gets the width of the texture. + +```csharp +public uint Width { get; set; } +``` + +Implements [Width](Velaptor.Content.ITexture.md#Velaptor.Content.ITexture.Width 'Velaptor.Content.ITexture.Width') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.TextureLoader.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.TextureLoader.md new file mode 100644 index 00000000..fb32d966 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.TextureLoader.md @@ -0,0 +1,99 @@ +--- +title: Velaptor.Content.TextureLoader +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Content](Velaptor.Content.md 'Velaptor.Content') + +#### TextureLoader Class + +Loads textures. + +```csharp +public sealed class TextureLoader : +Velaptor.Content.ILoader +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ TextureLoader + +Implements [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') +## Constructors + + + +### TextureLoader() Constructor + +Initializes a new instance of the [TextureLoader](Velaptor.Content.TextureLoader.md 'Velaptor.Content.TextureLoader') class. + +```csharp +public TextureLoader(); +``` +## Methods + + + +### Load(string) + +Loads a texture with the given [contentPathOrName](Velaptor.Content.TextureLoader.md#Velaptor.Content.TextureLoader.Load(string).contentPathOrName 'Velaptor.Content.TextureLoader.Load(string).contentPathOrName'). + +```csharp +public Velaptor.Content.ITexture Load(string contentPathOrName); +``` +#### Parameters + + + +`contentPathOrName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The full file path or name of the texture to load. + +Implements [Load(string)](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.Load(string) 'Velaptor.Content.ILoader.Load(string)') + +#### Returns +[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') +The loaded texture. + +#### Exceptions + +[System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') +Thrown if the [contentPathOrName](Velaptor.Content.TextureLoader.md#Velaptor.Content.TextureLoader.Load(string).contentPathOrName 'Velaptor.Content.TextureLoader.Load(string).contentPathOrName') is null or empty. + +[LoadTextureException](Velaptor.Content.Exceptions.LoadTextureException.md 'Velaptor.Content.Exceptions.LoadTextureException') +Thrown if the resulting texture content file path is invalid. + +[System.IO.FileNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileNotFoundException 'System.IO.FileNotFoundException') +Thrown if the texture file does not exist. + +[System.IO.IOException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.IOException 'System.IO.IOException') +The directory specified a file or the network name is not known. + +[System.UnauthorizedAccessException](https://docs.microsoft.com/en-us/dotnet/api/System.UnauthorizedAccessException 'System.UnauthorizedAccessException') +The caller does not have the required permissions. + +[System.IO.PathTooLongException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.PathTooLongException 'System.IO.PathTooLongException') +The specified path, file name, or both exceed the system-defined maximum length. + +[System.IO.DirectoryNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.DirectoryNotFoundException 'System.IO.DirectoryNotFoundException') +The specified path is invalid (for example, it is on an unmapped drive). + +[System.NotSupportedException](https://docs.microsoft.com/en-us/dotnet/api/System.NotSupportedException 'System.NotSupportedException') +The path contains a colon character `:` that is not part of a drive label. + + + +### Unload(string) + +Unloads the data with the given [contentPathOrName](Velaptor.Content.TextureLoader.md#Velaptor.Content.TextureLoader.Unload(string).contentPathOrName 'Velaptor.Content.TextureLoader.Unload(string).contentPathOrName'). + +```csharp +public void Unload(string contentPathOrName); +``` +#### Parameters + + + +`contentPathOrName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the content item to unload. + +Implements [Unload(string)](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.Unload(string) 'Velaptor.Content.ILoader.Unload(string)') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.md new file mode 100644 index 00000000..a753909f --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Content.md @@ -0,0 +1,26 @@ +--- +title: Velaptor.Content +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Content Namespace + +| Classes | | +| :--- | :--- | +| [AtlasData](Velaptor.Content.AtlasData.md 'Velaptor.Content.AtlasData') | Holds data relating to a texture atlas. | +| [AtlasLoader](Velaptor.Content.AtlasLoader.md 'Velaptor.Content.AtlasLoader') | Loads atlas data. | +| [Sound](Velaptor.Content.Sound.md 'Velaptor.Content.Sound') | A single sound that can be played, paused etc. | +| [SoundLoader](Velaptor.Content.SoundLoader.md 'Velaptor.Content.SoundLoader') | Loads sound content. | +| [Texture](Velaptor.Content.Texture.md 'Velaptor.Content.Texture') | The texture to render to a screen. | +| [TextureLoader](Velaptor.Content.TextureLoader.md 'Velaptor.Content.TextureLoader') | Loads textures. | + +| Interfaces | | +| :--- | :--- | +| [IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData') | Holds data for a texture atlas. | +| [IContent](Velaptor.Content.IContent.md 'Velaptor.Content.IContent') | Represents loadable content data. | +| [IContentLoadable](Velaptor.Content.IContentLoadable.md 'Velaptor.Content.IContentLoadable') | Provides the ability to load content. | +| [IContentPathResolver](Velaptor.Content.IContentPathResolver.md 'Velaptor.Content.IContentPathResolver') | Resolves file paths. | +| [ILoader<T>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') | Loads data of type [T](Velaptor.Content.ILoader_T_.md#Velaptor.Content.ILoader_T_.T 'Velaptor.Content.ILoader.T'). | +| [ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound') | A single sound that can be played, paused etc. | +| [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') | The texture to render to a screen. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.AppSettingsException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.AppSettingsException.md new file mode 100644 index 00000000..86a47acb --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.AppSettingsException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Exceptions.AppSettingsException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Exceptions](Velaptor.Exceptions.md 'Velaptor.Exceptions') + +#### AppSettingsException Class + +Thrown when there is an issue loading the application settings. + +```csharp +public sealed class AppSettingsException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ AppSettingsException +## Constructors + + + +### AppSettingsException() Constructor + +Initializes a new instance of the [AppSettingsException](Velaptor.Exceptions.AppSettingsException.md 'Velaptor.Exceptions.AppSettingsException') class. + +```csharp +public AppSettingsException(); +``` + + + +### AppSettingsException(string, Exception) Constructor + +Initializes a new instance of the [AppSettingsException](Velaptor.Exceptions.AppSettingsException.md 'Velaptor.Exceptions.AppSettingsException') class. + +```csharp +public AppSettingsException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### AppSettingsException(string) Constructor + +Initializes a new instance of the [AppSettingsException](Velaptor.Exceptions.AppSettingsException.md 'Velaptor.Exceptions.AppSettingsException') class. + +```csharp +public AppSettingsException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.AtlasException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.AtlasException.md new file mode 100644 index 00000000..3804f605 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.AtlasException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Exceptions.AtlasException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Exceptions](Velaptor.Exceptions.md 'Velaptor.Exceptions') + +#### AtlasException Class + +Thrown when there is an issue with an atlas. + +```csharp +public sealed class AtlasException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ AtlasException +## Constructors + + + +### AtlasException() Constructor + +Initializes a new instance of the [AtlasException](Velaptor.Exceptions.AtlasException.md 'Velaptor.Exceptions.AtlasException') class. + +```csharp +public AtlasException(); +``` + + + +### AtlasException(string, Exception) Constructor + +Initializes a new instance of the [AtlasException](Velaptor.Exceptions.AtlasException.md 'Velaptor.Exceptions.AtlasException') class. + +```csharp +public AtlasException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### AtlasException(string) Constructor + +Initializes a new instance of the [AtlasException](Velaptor.Exceptions.AtlasException.md 'Velaptor.Exceptions.AtlasException') class. + +```csharp +public AtlasException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.InvalidRenderEffectsException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.InvalidRenderEffectsException.md new file mode 100644 index 00000000..abbe0819 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.InvalidRenderEffectsException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Exceptions.InvalidRenderEffectsException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Exceptions](Velaptor.Exceptions.md 'Velaptor.Exceptions') + +#### InvalidRenderEffectsException Class + +Thrown when an invalid [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') value is used. + +```csharp +public sealed class InvalidRenderEffectsException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ InvalidRenderEffectsException +## Constructors + + + +### InvalidRenderEffectsException() Constructor + +Initializes a new instance of the [InvalidRenderEffectsException](Velaptor.Exceptions.InvalidRenderEffectsException.md 'Velaptor.Exceptions.InvalidRenderEffectsException') class. + +```csharp +public InvalidRenderEffectsException(); +``` + + + +### InvalidRenderEffectsException(string, Exception) Constructor + +Initializes a new instance of the [InvalidRenderEffectsException](Velaptor.Exceptions.InvalidRenderEffectsException.md 'Velaptor.Exceptions.InvalidRenderEffectsException') class. + +```csharp +public InvalidRenderEffectsException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### InvalidRenderEffectsException(string) Constructor + +Initializes a new instance of the [InvalidRenderEffectsException](Velaptor.Exceptions.InvalidRenderEffectsException.md 'Velaptor.Exceptions.InvalidRenderEffectsException') class. + +```csharp +public InvalidRenderEffectsException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.LoadEmbeddedResourceException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.LoadEmbeddedResourceException.md new file mode 100644 index 00000000..012b0fbf --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.LoadEmbeddedResourceException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Exceptions.LoadEmbeddedResourceException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Exceptions](Velaptor.Exceptions.md 'Velaptor.Exceptions') + +#### LoadEmbeddedResourceException Class + +Occurs when something goes wrong with loading an embedded resource. + +```csharp +public sealed class LoadEmbeddedResourceException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ LoadEmbeddedResourceException +## Constructors + + + +### LoadEmbeddedResourceException() Constructor + +Initializes a new instance of the [LoadEmbeddedResourceException](Velaptor.Exceptions.LoadEmbeddedResourceException.md 'Velaptor.Exceptions.LoadEmbeddedResourceException') class. + +```csharp +public LoadEmbeddedResourceException(); +``` + + + +### LoadEmbeddedResourceException(string, Exception) Constructor + +Initializes a new instance of the [LoadEmbeddedResourceException](Velaptor.Exceptions.LoadEmbeddedResourceException.md 'Velaptor.Exceptions.LoadEmbeddedResourceException') class. + +```csharp +public LoadEmbeddedResourceException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The exception message. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### LoadEmbeddedResourceException(string) Constructor + +Initializes a new instance of the [LoadEmbeddedResourceException](Velaptor.Exceptions.LoadEmbeddedResourceException.md 'Velaptor.Exceptions.LoadEmbeddedResourceException') class. + +```csharp +public LoadEmbeddedResourceException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The exception message. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.PushNotificationException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.PushNotificationException.md new file mode 100644 index 00000000..b7d7820c --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.PushNotificationException.md @@ -0,0 +1,90 @@ +--- +title: Velaptor.Exceptions.PushNotificationException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Exceptions](Velaptor.Exceptions.md 'Velaptor.Exceptions') + +#### PushNotificationException Class + +Thrown when there is an issue with the push notification system. + +```csharp +public sealed class PushNotificationException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ PushNotificationException +## Constructors + + + +### PushNotificationException() Constructor + +Initializes a new instance of the [PushNotificationException](Velaptor.Exceptions.PushNotificationException.md 'Velaptor.Exceptions.PushNotificationException') class. + +```csharp +public PushNotificationException(); +``` + + + +### PushNotificationException(string, Exception) Constructor + +Initializes a new instance of the [PushNotificationException](Velaptor.Exceptions.PushNotificationException.md 'Velaptor.Exceptions.PushNotificationException') class. + +```csharp +public PushNotificationException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### PushNotificationException(string, Guid) Constructor + +Initializes a new instance of the [PushNotificationException](Velaptor.Exceptions.PushNotificationException.md 'Velaptor.Exceptions.PushNotificationException') class. + +```csharp +public PushNotificationException(string subscriberSrc, System.Guid subscriptionId); +``` +#### Parameters + + + +`subscriberSrc` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The source of where the push notification came from. + + + +`subscriptionId` [System.Guid](https://docs.microsoft.com/en-us/dotnet/api/System.Guid 'System.Guid') + +The subscription ID. + + + +### PushNotificationException(string) Constructor + +Initializes a new instance of the [PushNotificationException](Velaptor.Exceptions.PushNotificationException.md 'Velaptor.Exceptions.PushNotificationException') class. + +```csharp +public PushNotificationException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.SceneAlreadyExistsException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.SceneAlreadyExistsException.md new file mode 100644 index 00000000..00f36876 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.SceneAlreadyExistsException.md @@ -0,0 +1,90 @@ +--- +title: Velaptor.Exceptions.SceneAlreadyExistsException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Exceptions](Velaptor.Exceptions.md 'Velaptor.Exceptions') + +#### SceneAlreadyExistsException Class + +Thrown when a scene already exists. + +```csharp +public sealed class SceneAlreadyExistsException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ SceneAlreadyExistsException +## Constructors + + + +### SceneAlreadyExistsException() Constructor + +Initializes a new instance of the [SceneAlreadyExistsException](Velaptor.Exceptions.SceneAlreadyExistsException.md 'Velaptor.Exceptions.SceneAlreadyExistsException') class. + +```csharp +public SceneAlreadyExistsException(); +``` + + + +### SceneAlreadyExistsException(string, Exception) Constructor + +Initializes a new instance of the [SceneAlreadyExistsException](Velaptor.Exceptions.SceneAlreadyExistsException.md 'Velaptor.Exceptions.SceneAlreadyExistsException') class. + +```csharp +public SceneAlreadyExistsException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### SceneAlreadyExistsException(string, Guid) Constructor + +Initializes a new instance of the [SceneAlreadyExistsException](Velaptor.Exceptions.SceneAlreadyExistsException.md 'Velaptor.Exceptions.SceneAlreadyExistsException') class. + +```csharp +public SceneAlreadyExistsException(string name, System.Guid id); +``` +#### Parameters + + + +`name` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the scene. + + + +`id` [System.Guid](https://docs.microsoft.com/en-us/dotnet/api/System.Guid 'System.Guid') + +The scene ID. + + + +### SceneAlreadyExistsException(string) Constructor + +Initializes a new instance of the [SceneAlreadyExistsException](Velaptor.Exceptions.SceneAlreadyExistsException.md 'Velaptor.Exceptions.SceneAlreadyExistsException') class. + +```csharp +public SceneAlreadyExistsException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.SystemDisplayException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.SystemDisplayException.md new file mode 100644 index 00000000..9fda6cc6 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.SystemDisplayException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Exceptions.SystemDisplayException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Exceptions](Velaptor.Exceptions.md 'Velaptor.Exceptions') + +#### SystemDisplayException Class + +Occurs when there is an issue with one of the system displays. + +```csharp +public sealed class SystemDisplayException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ SystemDisplayException +## Constructors + + + +### SystemDisplayException() Constructor + +Initializes a new instance of the [SystemDisplayException](Velaptor.Exceptions.SystemDisplayException.md 'Velaptor.Exceptions.SystemDisplayException') class. + +```csharp +public SystemDisplayException(); +``` + + + +### SystemDisplayException(string, Exception) Constructor + +Initializes a new instance of the [SystemDisplayException](Velaptor.Exceptions.SystemDisplayException.md 'Velaptor.Exceptions.SystemDisplayException') class. + +```csharp +public SystemDisplayException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### SystemDisplayException(string) Constructor + +Initializes a new instance of the [SystemDisplayException](Velaptor.Exceptions.SystemDisplayException.md 'Velaptor.Exceptions.SystemDisplayException') class. + +```csharp +public SystemDisplayException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.md new file mode 100644 index 00000000..cd223c21 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Exceptions.md @@ -0,0 +1,17 @@ +--- +title: Velaptor.Exceptions +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Exceptions Namespace + +| Classes | | +| :--- | :--- | +| [AppSettingsException](Velaptor.Exceptions.AppSettingsException.md 'Velaptor.Exceptions.AppSettingsException') | Thrown when there is an issue loading the application settings. | +| [AtlasException](Velaptor.Exceptions.AtlasException.md 'Velaptor.Exceptions.AtlasException') | Thrown when there is an issue with an atlas. | +| [InvalidRenderEffectsException](Velaptor.Exceptions.InvalidRenderEffectsException.md 'Velaptor.Exceptions.InvalidRenderEffectsException') | Thrown when an invalid [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') value is used. | +| [LoadEmbeddedResourceException](Velaptor.Exceptions.LoadEmbeddedResourceException.md 'Velaptor.Exceptions.LoadEmbeddedResourceException') | Occurs when something goes wrong with loading an embedded resource. | +| [PushNotificationException](Velaptor.Exceptions.PushNotificationException.md 'Velaptor.Exceptions.PushNotificationException') | Thrown when there is an issue with the push notification system. | +| [SceneAlreadyExistsException](Velaptor.Exceptions.SceneAlreadyExistsException.md 'Velaptor.Exceptions.SceneAlreadyExistsException') | Thrown when a scene already exists. | +| [SystemDisplayException](Velaptor.Exceptions.SystemDisplayException.md 'Velaptor.Exceptions.SystemDisplayException') | Occurs when there is an issue with one of the system displays. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.ExtensionMethods.ContentExtensions.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.ExtensionMethods.ContentExtensions.md new file mode 100644 index 00000000..d01d90ef --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.ExtensionMethods.ContentExtensions.md @@ -0,0 +1,155 @@ +--- +title: Velaptor.ExtensionMethods.ContentExtensions +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.ExtensionMethods](Velaptor.ExtensionMethods.md 'Velaptor.ExtensionMethods') + +#### ContentExtensions Class + +Provides content related extension methods. + +```csharp +public static class ContentExtensions +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ ContentExtensions +## Methods + + + +### Load(this ILoader<IFont>, string, uint) + +Loads font content from the application's content directory or directly using a full file path. + +```csharp +public static Velaptor.Content.Fonts.IFont Load(this Velaptor.Content.ILoader loader, string fontName, uint size); +``` +#### Parameters + + + +`loader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') + +The font loader. + + + +`fontName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name or full file path to the font with metadata. + + + +`size` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The size of the font. + +#### Returns +[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') +The loaded font. + +#### Exceptions + +[System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') +Occurs when the [fontName](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Load(thisVelaptor.Content.ILoader_Velaptor.Content.Fonts.IFont_,string,uint).fontName 'Velaptor.ExtensionMethods.ContentExtensions.Load(this Velaptor.Content.ILoader, string, uint).fontName') argument is null or empty. + +[System.IO.FileNotFoundException](https://docs.microsoft.com/en-us/dotnet/api/System.IO.FileNotFoundException 'System.IO.FileNotFoundException') +Occurs if the font file does not exist. + +#### Remarks +If a path is used, it must be a fully qualified file path. + +Directory paths are not valid. + + + +### Unload(this ILoader<IFont>, IFont) + +Unloads the given [font](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Unload(thisVelaptor.Content.ILoader_Velaptor.Content.Fonts.IFont_,Velaptor.Content.Fonts.IFont).font 'Velaptor.ExtensionMethods.ContentExtensions.Unload(this Velaptor.Content.ILoader, Velaptor.Content.Fonts.IFont).font'). + +```csharp +public static void Unload(this Velaptor.Content.ILoader loader, Velaptor.Content.Fonts.IFont? font); +``` +#### Parameters + + + +`loader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') + +The loader. + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + +The content to unload. + + + +### Unload(this ILoader<IAtlasData>, IAtlasData) + +Unloads the given [atlas](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Unload(thisVelaptor.Content.ILoader_Velaptor.Content.IAtlasData_,Velaptor.Content.IAtlasData).atlas 'Velaptor.ExtensionMethods.ContentExtensions.Unload(this Velaptor.Content.ILoader, Velaptor.Content.IAtlasData).atlas'). + +```csharp +public static void Unload(this Velaptor.Content.ILoader loader, Velaptor.Content.IAtlasData? atlas); +``` +#### Parameters + + + +`loader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') + +The loader. + + + +`atlas` [IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData') + +The content to unload. + + + +### Unload(this ILoader<ISound>, ISound) + +Unloads the given [sound](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Unload(thisVelaptor.Content.ILoader_Velaptor.Content.ISound_,Velaptor.Content.ISound).sound 'Velaptor.ExtensionMethods.ContentExtensions.Unload(this Velaptor.Content.ILoader, Velaptor.Content.ISound).sound'). + +```csharp +public static void Unload(this Velaptor.Content.ILoader loader, Velaptor.Content.ISound? sound); +``` +#### Parameters + + + +`loader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') + +The loader. + + + +`sound` [ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound') + +The content to unload. + + + +### Unload(this ILoader<ITexture>, ITexture) + +Unloads the given [texture](Velaptor.ExtensionMethods.ContentExtensions.md#Velaptor.ExtensionMethods.ContentExtensions.Unload(thisVelaptor.Content.ILoader_Velaptor.Content.ITexture_,Velaptor.Content.ITexture).texture 'Velaptor.ExtensionMethods.ContentExtensions.Unload(this Velaptor.Content.ILoader, Velaptor.Content.ITexture).texture'). + +```csharp +public static void Unload(this Velaptor.Content.ILoader loader, Velaptor.Content.ITexture? texture); +``` +#### Parameters + + + +`loader` [Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') + +The loader. + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The content to unload. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.ExtensionMethods.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.ExtensionMethods.md new file mode 100644 index 00000000..81a781d0 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.ExtensionMethods.md @@ -0,0 +1,11 @@ +--- +title: Velaptor.ExtensionMethods +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.ExtensionMethods Namespace + +| Classes | | +| :--- | :--- | +| [ContentExtensions](Velaptor.ExtensionMethods.ContentExtensions.md 'Velaptor.ExtensionMethods.ContentExtensions') | Provides content related extension methods. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.ContentLoaderFactory.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.ContentLoaderFactory.md new file mode 100644 index 00000000..eaa6fee9 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.ContentLoaderFactory.md @@ -0,0 +1,73 @@ +--- +title: Velaptor.Factories.ContentLoaderFactory +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Factories](Velaptor.Factories.md 'Velaptor.Factories') + +#### ContentLoaderFactory Class + +Creates instances of a content loader. + +```csharp +public static class ContentLoaderFactory +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ ContentLoaderFactory +## Methods + + + +### CreateAtlasLoader() + +Creates a loader for loading atlas data from disk. + +```csharp +public static Velaptor.Content.ILoader CreateAtlasLoader(); +``` + +#### Returns +[Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IAtlasData](Velaptor.Content.IAtlasData.md 'Velaptor.Content.IAtlasData')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') +A loader for loading texture atlas data. + + + +### CreateFontLoader() + +Creates a loader that loads fonts from disk for rendering test. + +```csharp +public static Velaptor.Content.ILoader CreateFontLoader(); +``` + +#### Returns +[Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') +A loader for loading sound data. + + + +### CreateSoundLoader() + +Creates a loader that loads sounds from disk. + +```csharp +public static Velaptor.Content.ILoader CreateSoundLoader(); +``` + +#### Returns +[Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[ISound](Velaptor.Content.ISound.md 'Velaptor.Content.ISound')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') +A loader for loading sound data. + + + +### CreateTextureLoader() + +Creates a loader that loads textures from disk. + +```csharp +public static Velaptor.Content.ILoader CreateTextureLoader(); +``` + +#### Returns +[Velaptor.Content.ILoader<](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader')[ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture')[>](Velaptor.Content.ILoader_T_.md 'Velaptor.Content.ILoader') +A loader for loading textures. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.HardwareFactory.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.HardwareFactory.md new file mode 100644 index 00000000..8e91323b --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.HardwareFactory.md @@ -0,0 +1,73 @@ +--- +title: Velaptor.Factories.HardwareFactory +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Factories](Velaptor.Factories.md 'Velaptor.Factories') + +#### HardwareFactory Class + +Generates input type objects for processing input such as the keyboard and mouse. + +```csharp +public static class HardwareFactory +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ HardwareFactory +## Methods + + + +### GetDisplays() + +Gets all of the displays in the system. + +```csharp +public static System.Collections.Immutable.ImmutableArray GetDisplays(); +``` + +#### Returns +[System.Collections.Immutable.ImmutableArray<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Immutable.ImmutableArray-1 'System.Collections.Immutable.ImmutableArray`1')[SystemDisplay](Velaptor.Hardware.SystemDisplay.md 'Velaptor.Hardware.SystemDisplay')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Immutable.ImmutableArray-1 'System.Collections.Immutable.ImmutableArray`1') +The list of displays. + + + +### GetKeyboard() + +Gets a keyboard object. + +```csharp +public static Velaptor.Input.IAppInput GetKeyboard(); +``` + +#### Returns +[Velaptor.Input.IAppInput<](Velaptor.Input.IAppInput_TState_.md 'Velaptor.Input.IAppInput')[KeyboardState](Velaptor.Input.KeyboardState.md 'Velaptor.Input.KeyboardState')[>](Velaptor.Input.IAppInput_TState_.md 'Velaptor.Input.IAppInput') +The keyboard singleton object. + + + +### GetMainDisplay() + +Gets the primary display in the system. + +```csharp +public static Velaptor.Hardware.SystemDisplay GetMainDisplay(); +``` + +#### Returns +[SystemDisplay](Velaptor.Hardware.SystemDisplay.md 'Velaptor.Hardware.SystemDisplay') +The system's primary display. + + + +### GetMouse() + +Gets a mouse object. + +```csharp +public static Velaptor.Input.IAppInput GetMouse(); +``` + +#### Returns +[Velaptor.Input.IAppInput<](Velaptor.Input.IAppInput_TState_.md 'Velaptor.Input.IAppInput')[MouseState](Velaptor.Input.MouseState.md 'Velaptor.Input.MouseState')[>](Velaptor.Input.IAppInput_TState_.md 'Velaptor.Input.IAppInput') +The keyboard singleton object. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.PathResolverFactory.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.PathResolverFactory.md new file mode 100644 index 00000000..ec841d6c --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.PathResolverFactory.md @@ -0,0 +1,101 @@ +--- +title: Velaptor.Factories.PathResolverFactory +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Factories](Velaptor.Factories.md 'Velaptor.Factories') + +#### PathResolverFactory Class + +Creates path resolver instances. + +```csharp +public static class PathResolverFactory +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ PathResolverFactory +## Methods + + + +### CreateAtlasPathResolver() + +Creates a path resolver that resolves paths to texture atlas textures. + +```csharp +public static Velaptor.Content.IContentPathResolver CreateAtlasPathResolver(); +``` + +#### Returns +[IContentPathResolver](Velaptor.Content.IContentPathResolver.md 'Velaptor.Content.IContentPathResolver') +The resolver to texture content. + + + +### CreateContentFontPathResolver() + +Creates a path resolver that resolves paths to fonts in the application's content directory. + +```csharp +public static Velaptor.Content.IContentPathResolver CreateContentFontPathResolver(); +``` + +#### Returns +[IContentPathResolver](Velaptor.Content.IContentPathResolver.md 'Velaptor.Content.IContentPathResolver') +The resolver instance. + + + +### CreateFontPathResolver() + +Creates a path resolver that resolves paths to font content. + +```csharp +public static Velaptor.Content.IContentPathResolver CreateFontPathResolver(); +``` + +#### Returns +[IContentPathResolver](Velaptor.Content.IContentPathResolver.md 'Velaptor.Content.IContentPathResolver') +The resolver to atlas content. + + + +### CreateSoundPathResolver() + +Creates a path resolver that resolves paths to sound content. + +```csharp +public static Velaptor.Content.IContentPathResolver CreateSoundPathResolver(); +``` + +#### Returns +[IContentPathResolver](Velaptor.Content.IContentPathResolver.md 'Velaptor.Content.IContentPathResolver') +The resolver to sound content. + + + +### CreateSystemFontPathResolver() + +Creates a path resolver that resolves paths to fonts in the system's font directory. + +```csharp +public static Velaptor.Content.IContentPathResolver CreateSystemFontPathResolver(); +``` + +#### Returns +[IContentPathResolver](Velaptor.Content.IContentPathResolver.md 'Velaptor.Content.IContentPathResolver') +The resolver instance. + + + +### CreateTexturePathResolver() + +Creates a path resolver that resolves paths to texture content. + +```csharp +public static Velaptor.Content.IContentPathResolver CreateTexturePathResolver(); +``` + +#### Returns +[IContentPathResolver](Velaptor.Content.IContentPathResolver.md 'Velaptor.Content.IContentPathResolver') +The resolver to texture content. \ No newline at end of file diff --git a/docs/api/Velaptor.Graphics.Renderers.IRendererFactory.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.RendererFactory.md similarity index 56% rename from docs/api/Velaptor.Graphics.Renderers.IRendererFactory.md rename to versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.RendererFactory.md index 777e5e59..f0fdd0bd 100644 --- a/docs/api/Velaptor.Graphics.Renderers.IRendererFactory.md +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.RendererFactory.md @@ -1,100 +1,87 @@ --- -title: Velaptor.Graphics.Renderers.IRendererFactory +title: Velaptor.Factories.RendererFactory --- #### [Velaptor](Namespaces.md 'Velaptor Namespaces') -### [Velaptor.Graphics.Renderers](Velaptor.Graphics.Renderers.md 'Velaptor.Graphics.Renderers') +### [Velaptor.Factories](Velaptor.Factories.md 'Velaptor.Factories') -#### IRendererFactory Interface +#### RendererFactory Class -Creates renderer instances. +Creates renderers for rendering different types of graphics. ```csharp -public interface IRendererFactory +public static class RendererFactory ``` -Derived -↳ [RendererFactory](Velaptor.Factories.RendererFactory.md 'Velaptor.Factories.RendererFactory') +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ RendererFactory ## Methods - + ### CreateBatcher() Creates an instance of [IBatcher](Velaptor.Batching.IBatcher.md 'Velaptor.Batching.IBatcher') to start and stop batching. ```csharp -Velaptor.Batching.IBatcher CreateBatcher(); +public static Velaptor.Batching.IBatcher CreateBatcher(); ``` #### Returns [IBatcher](Velaptor.Batching.IBatcher.md 'Velaptor.Batching.IBatcher') The batcher instance. - + ### CreateFontRenderer() Creates an instance of the [IFontRenderer](Velaptor.Graphics.Renderers.IFontRenderer.md 'Velaptor.Graphics.Renderers.IFontRenderer'). ```csharp -Velaptor.Graphics.Renderers.IFontRenderer CreateFontRenderer(); +public static Velaptor.Graphics.Renderers.IFontRenderer CreateFontRenderer(); ``` #### Returns [IFontRenderer](Velaptor.Graphics.Renderers.IFontRenderer.md 'Velaptor.Graphics.Renderers.IFontRenderer') The font renderer. -#### Remarks -`NOTE:` the renderer is a singleton. - - + ### CreateLineRenderer() Creates an instance of the [ILineRenderer](Velaptor.Graphics.Renderers.ILineRenderer.md 'Velaptor.Graphics.Renderers.ILineRenderer'). ```csharp -Velaptor.Graphics.Renderers.ILineRenderer CreateLineRenderer(); +public static Velaptor.Graphics.Renderers.ILineRenderer CreateLineRenderer(); ``` #### Returns [ILineRenderer](Velaptor.Graphics.Renderers.ILineRenderer.md 'Velaptor.Graphics.Renderers.ILineRenderer') The line renderer. -#### Remarks -`NOTE:` the renderer is a singleton. - - + ### CreateShapeRenderer() Creates an instance of the [IShapeRenderer](Velaptor.Graphics.Renderers.IShapeRenderer.md 'Velaptor.Graphics.Renderers.IShapeRenderer'). ```csharp -Velaptor.Graphics.Renderers.IShapeRenderer CreateShapeRenderer(); +public static Velaptor.Graphics.Renderers.IShapeRenderer CreateShapeRenderer(); ``` #### Returns [IShapeRenderer](Velaptor.Graphics.Renderers.IShapeRenderer.md 'Velaptor.Graphics.Renderers.IShapeRenderer') The rectangle renderer. -#### Remarks -`NOTE:` the renderer is a singleton. - - + ### CreateTextureRenderer() Creates an instance of the [ITextureRenderer](Velaptor.Graphics.Renderers.ITextureRenderer.md 'Velaptor.Graphics.Renderers.ITextureRenderer'). ```csharp -Velaptor.Graphics.Renderers.ITextureRenderer CreateTextureRenderer(); +public static Velaptor.Graphics.Renderers.ITextureRenderer CreateTextureRenderer(); ``` #### Returns [ITextureRenderer](Velaptor.Graphics.Renderers.ITextureRenderer.md 'Velaptor.Graphics.Renderers.ITextureRenderer') -The texture renderer. - -#### Remarks -`NOTE:` the renderer is a singleton. \ No newline at end of file +The texture renderer. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.md new file mode 100644 index 00000000..a30995b2 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Factories.md @@ -0,0 +1,14 @@ +--- +title: Velaptor.Factories +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Factories Namespace + +| Classes | | +| :--- | :--- | +| [ContentLoaderFactory](Velaptor.Factories.ContentLoaderFactory.md 'Velaptor.Factories.ContentLoaderFactory') | Creates instances of a content loader. | +| [HardwareFactory](Velaptor.Factories.HardwareFactory.md 'Velaptor.Factories.HardwareFactory') | Generates input type objects for processing input such as the keyboard and mouse. | +| [PathResolverFactory](Velaptor.Factories.PathResolverFactory.md 'Velaptor.Factories.PathResolverFactory') | Creates path resolver instances. | +| [RendererFactory](Velaptor.Factories.RendererFactory.md 'Velaptor.Factories.RendererFactory') | Creates renderers for rendering different types of graphics. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.FrameTime.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.FrameTime.md new file mode 100644 index 00000000..8e98152a --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.FrameTime.md @@ -0,0 +1,44 @@ +--- +title: Velaptor.FrameTime +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +#### FrameTime Struct + +Holds timing information for a loop iteration. + +```csharp +public readonly struct FrameTime : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[FrameTime](Velaptor.FrameTime.md 'Velaptor.FrameTime')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Properties + + + +### ElapsedTime + +Gets the total time that has passed for the current frame. + +```csharp +public System.TimeSpan ElapsedTime { get; set; } +``` + +#### Property Value +[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') + + + +### TotalTime + +Gets the total time that the entire application has been running. + +```csharp +public System.TimeSpan TotalTime { get; set; } +``` + +#### Property Value +[System.TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/System.TimeSpan 'System.TimeSpan') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.GameHelpers.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.GameHelpers.md new file mode 100644 index 00000000..123d037e --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.GameHelpers.md @@ -0,0 +1,803 @@ +--- +title: Velaptor.GameHelpers +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +#### GameHelpers Class + +Provides extension helper methods for common game related operations. + +```csharp +public static class GameHelpers +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ GameHelpers +## Methods + + + +### ApplySize(this float, float) + +Returns the given [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisfloat,float).value 'Velaptor.GameHelpers.ApplySize(this float, float).value') with the given [size](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisfloat,float).size 'Velaptor.GameHelpers.ApplySize(this float, float).size') applied. + +```csharp +public static float ApplySize(this float value, float size); +``` +#### Parameters + + + +`value` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to apply the size to. + + + +`size` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The size to apply. + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +The value after the size has been applied. + +### Example +If the value was 3 and the size was 2, then the result would be 6. + +#### Remarks +A [size](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisfloat,float).size 'Velaptor.GameHelpers.ApplySize(this float, float).size') value of 1 represents 100% or the unchanged normal size of the value. +If the value of [size](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisfloat,float).size 'Velaptor.GameHelpers.ApplySize(this float, float).size') is 2, then the result would be the given +[value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisfloat,float).value 'Velaptor.GameHelpers.ApplySize(this float, float).value') that is doubled. + + + +### ApplySize(this RectangleF, float) + +Returns the given [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisSystem.Drawing.RectangleF,float).value 'Velaptor.GameHelpers.ApplySize(this System.Drawing.RectangleF, float).value') with the given [size](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisSystem.Drawing.RectangleF,float).size 'Velaptor.GameHelpers.ApplySize(this System.Drawing.RectangleF, float).size') applied. + +```csharp +public static System.Drawing.RectangleF ApplySize(this System.Drawing.RectangleF value, float size); +``` +#### Parameters + + + +`value` [System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF') + +The [System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF') to apply the size to. + + + +`size` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The size to apply. + +#### Returns +[System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF') +The result after the size has been applied. + +#### Remarks +The size will be applied to the following: +- [System.Drawing.RectangleF.X](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF.X 'System.Drawing.RectangleF.X') +- [System.Drawing.RectangleF.Y](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF.Y 'System.Drawing.RectangleF.Y') +- [System.Drawing.RectangleF.Width](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF.Width 'System.Drawing.RectangleF.Width') +- [System.Drawing.RectangleF.Height](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF.Height 'System.Drawing.RectangleF.Height') + + + +### ApplySize(this SizeF, float) + +Returns the given [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisSystem.Drawing.SizeF,float).value 'Velaptor.GameHelpers.ApplySize(this System.Drawing.SizeF, float).value') with the given [size](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisSystem.Drawing.SizeF,float).size 'Velaptor.GameHelpers.ApplySize(this System.Drawing.SizeF, float).size') applied. + +```csharp +public static System.Drawing.SizeF ApplySize(this System.Drawing.SizeF value, float size); +``` +#### Parameters + + + +`value` [System.Drawing.SizeF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.SizeF 'System.Drawing.SizeF') + +The [System.Drawing.SizeF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.SizeF 'System.Drawing.SizeF') to apply the size to. + + + +`size` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The size to apply. + +#### Returns +[System.Drawing.SizeF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.SizeF 'System.Drawing.SizeF') +The result after the size has been applied. + +#### Remarks +The size will be applied to the following: +- [System.Drawing.SizeF.Width](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.SizeF.Width 'System.Drawing.SizeF.Width') +- [System.Drawing.SizeF.Height](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.SizeF.Height 'System.Drawing.SizeF.Height') + + + +### ApplySize(this uint, float) + +Returns the given [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisuint,float).value 'Velaptor.GameHelpers.ApplySize(this uint, float).value') with the given [size](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisuint,float).size 'Velaptor.GameHelpers.ApplySize(this uint, float).size') applied. + +```csharp +public static float ApplySize(this uint value, float size); +``` +#### Parameters + + + +`value` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The value to apply the size to. + + + +`size` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The size to apply. + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +The value after the size has been applied. + +### Example +If the value was 3 and the size was 2, then the result would be 6. + +#### Remarks +A [size](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisuint,float).size 'Velaptor.GameHelpers.ApplySize(this uint, float).size') value of 1 represents 100% or the unchanged normal size of the value. +If the value of [size](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisuint,float).size 'Velaptor.GameHelpers.ApplySize(this uint, float).size') is 2, then the result would be the given +[value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisuint,float).value 'Velaptor.GameHelpers.ApplySize(this uint, float).value') that is doubled. + + + +### ApplySize(this GlyphMetrics, float) + +Returns the given [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisVelaptor.Graphics.GlyphMetrics,float).value 'Velaptor.GameHelpers.ApplySize(this Velaptor.Graphics.GlyphMetrics, float).value') with the given [size](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ApplySize(thisVelaptor.Graphics.GlyphMetrics,float).size 'Velaptor.GameHelpers.ApplySize(this Velaptor.Graphics.GlyphMetrics, float).size') applied. + +```csharp +public static Velaptor.Graphics.GlyphMetrics ApplySize(this Velaptor.Graphics.GlyphMetrics value, float size); +``` +#### Parameters + + + +`value` [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics') + +The [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics') to apply the size to. + + + +`size` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The size to apply. + +#### Returns +[GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics') +The result after the size has been applied. + +#### Remarks +The size will be applied to the following: +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[GlyphBounds](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.GlyphBounds 'Velaptor.Graphics.GlyphMetrics.GlyphBounds') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[Ascender](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.Ascender 'Velaptor.Graphics.GlyphMetrics.Ascender') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[Descender](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.Descender 'Velaptor.Graphics.GlyphMetrics.Descender') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[HorizontalAdvance](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.HorizontalAdvance 'Velaptor.Graphics.GlyphMetrics.HorizontalAdvance') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[HoriBearingX](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.HoriBearingX 'Velaptor.Graphics.GlyphMetrics.HoriBearingX') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[HoriBearingY](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.HoriBearingY 'Velaptor.Graphics.GlyphMetrics.HoriBearingY') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[GlyphWidth](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.GlyphWidth 'Velaptor.Graphics.GlyphMetrics.GlyphWidth') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[GlyphHeight](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.GlyphHeight 'Velaptor.Graphics.GlyphMetrics.GlyphHeight') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[XMin](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.XMin 'Velaptor.Graphics.GlyphMetrics.XMin') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[XMax](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.XMax 'Velaptor.Graphics.GlyphMetrics.XMax') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[YMin](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.YMin 'Velaptor.Graphics.GlyphMetrics.YMin') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[YMax](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.YMax 'Velaptor.Graphics.GlyphMetrics.YMax') + +The size will NOT be applied to the following: +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[Glyph](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.Glyph 'Velaptor.Graphics.GlyphMetrics.Glyph') +- [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics').[CharIndex](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.CharIndex 'Velaptor.Graphics.GlyphMetrics.CharIndex') + + + +### DecreaseBrightness(this Color, float) + +Decreases the brightness of the color using the given [brightness](Velaptor.GameHelpers.md#Velaptor.GameHelpers.DecreaseBrightness(thisSystem.Drawing.Color,float).brightness 'Velaptor.GameHelpers.DecreaseBrightness(this System.Drawing.Color, float).brightness') value. + +```csharp +public static System.Drawing.Color DecreaseBrightness(this System.Drawing.Color clr, float brightness); +``` +#### Parameters + + + +`clr` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color to change. + + + +`brightness` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The amount of brightness to apply. + +#### Returns +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') +The new color with the brightness applied. + +### Example + +```csharp +var clr = Color.FromArgb(255, 10, 20, 30); + + +// Increase the brightness by 20% +clr = clr.IncreaseBrightness(0.2f); +``` + +In the example above, the values would equal the results below: +- Alpha value would be unchanged with a value of 255. +- Red component with brightness applied would result in a value of 8. +- Green component with brightness applied would result in a value of 16. +- Blue component with brightness applied would result in a value of 24. + +#### Remarks + +The [brightness](Velaptor.GameHelpers.md#Velaptor.GameHelpers.DecreaseBrightness(thisSystem.Drawing.Color,float).brightness 'Velaptor.GameHelpers.DecreaseBrightness(this System.Drawing.Color, float).brightness') value must be a value between 0.0 and 1.0. + +If a value lower than 0.0 or greater than 1.0, the brightness will automatically +be adjusted within the range of 0.0 to 1.0. + +Think of the [brightness](Velaptor.GameHelpers.md#Velaptor.GameHelpers.DecreaseBrightness(thisSystem.Drawing.Color,float).brightness 'Velaptor.GameHelpers.DecreaseBrightness(this System.Drawing.Color, float).brightness') value as a percentage between 0% and 100%. + +The [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color').[System.Drawing.Color.A](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color.A 'System.Drawing.Color.A') color component is not effected. + + + +### DoesNotContain(this string, char) + +Returns a value indicating whether or not a specified character occurs within this string. + +```csharp +public static bool DoesNotContain(this string stringToSearchIn, char value); +``` +#### Parameters + + + +`stringToSearchIn` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The string to search that may or may not contain the [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.DoesNotContain(thisstring,char).value 'Velaptor.GameHelpers.DoesNotContain(this string, char).value'). + + + +`value` [System.Char](https://docs.microsoft.com/en-us/dotnet/api/System.Char 'System.Char') + +The character to seek. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the value parameter does not occur within this string. + + + +### DoesNotContain(this string, string) + +Returns a value indicating whether or not a specified substring occurs within this string. + +```csharp +public static bool DoesNotContain(this string stringToSearchIn, string value); +``` +#### Parameters + + + +`stringToSearchIn` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The string to search that may or may not contain the [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.DoesNotContain(thisstring,string).value 'Velaptor.GameHelpers.DoesNotContain(this string, string).value'). + + + +`value` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The string to seek. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the value parameter does not occur within this string. + + + +### DoesNotOnlyContainsLetters(this string) + +Returns a value indicating whether or not this string does not only contain letters. + +```csharp +public static bool DoesNotOnlyContainsLetters(this string value); +``` +#### Parameters + + + +`value` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The string to check. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the string contains other characters besides letters. + + + +### ForceNegative(this float) + +Sets the value to negative if it's positive. + +```csharp +public static float ForceNegative(this float value); +``` +#### Parameters + + + +`value` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to force. + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +The value as a negative number. + + + +### ForcePositive(this float) + +Sets the value to positive if it's negative. + +```csharp +public static float ForcePositive(this float value); +``` +#### Parameters + + + +`value` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to force. + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +The value as a positive number. + + + +### GetPosition(this RectangleF) + +Returns the position in the given [rect](Velaptor.GameHelpers.md#Velaptor.GameHelpers.GetPosition(thisSystem.Drawing.RectangleF).rect 'Velaptor.GameHelpers.GetPosition(this System.Drawing.RectangleF).rect') as a [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2'). + +```csharp +public static System.Numerics.Vector2 GetPosition(this System.Drawing.RectangleF rect); +``` +#### Parameters + + + +`rect` [System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF') + +The rect that contains the position. + +#### Returns +[System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') +The [System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF') position as a [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2'). + + + +### IncreaseBrightness(this Color, float) + +Increases the brightness of the color using the given [brightness](Velaptor.GameHelpers.md#Velaptor.GameHelpers.IncreaseBrightness(thisSystem.Drawing.Color,float).brightness 'Velaptor.GameHelpers.IncreaseBrightness(this System.Drawing.Color, float).brightness') value. + +```csharp +public static System.Drawing.Color IncreaseBrightness(this System.Drawing.Color clr, float brightness); +``` +#### Parameters + + + +`clr` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color to change. + + + +`brightness` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The amount of brightness to apply. + +#### Returns +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') +The new color with the brightness applied. + +### Example + +```csharp +var clr = Color.FromArgb(255, 10, 20, 30); + + +// Increase the brightness by 20% +clr = clr.IncreaseBrightness(0.2f); +``` + +In the example above, the values would equal the results below: +- Alpha component would be unchanged with a value of 255. +- Red component with brightness applied would result in a value of 12. +- Green component with brightness applied would result in a value of 24. +- Blue component with brightness applied would result in a value of 36. + +#### Remarks + +The [brightness](Velaptor.GameHelpers.md#Velaptor.GameHelpers.IncreaseBrightness(thisSystem.Drawing.Color,float).brightness 'Velaptor.GameHelpers.IncreaseBrightness(this System.Drawing.Color, float).brightness') value must be a value between 0.0 and 1.0. + +If a value lower than 0.0 or greater than 1.0, the brightness will automatically +be adjusted within the range of 0.0 to 1.0. + +Think of the [brightness](Velaptor.GameHelpers.md#Velaptor.GameHelpers.IncreaseBrightness(thisSystem.Drawing.Color,float).brightness 'Velaptor.GameHelpers.IncreaseBrightness(this System.Drawing.Color, float).brightness') value as a percentage between 0% and 100%. + +The [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color').[System.Drawing.Color.A](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color.A 'System.Drawing.Color.A') color component is not effected. + + + +### IsLetter(this char) + +Returns a value indicating whether or not the character is a letter. + +```csharp +public static bool IsLetter(this char character); +``` +#### Parameters + + + +`character` [System.Char](https://docs.microsoft.com/en-us/dotnet/api/System.Char 'System.Char') + +The character to check. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +True if the character is an upper or lower case letter. + + + +### IsNotLetter(this char) + +Returns a value indicating whether or not the character is not a letter. + +```csharp +public static bool IsNotLetter(this char character); +``` +#### Parameters + + + +`character` [System.Char](https://docs.microsoft.com/en-us/dotnet/api/System.Char 'System.Char') + +The character to check. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +True if the character is not an upper or lower case letter. + + + +### MapValue(this byte, byte, byte, byte, byte) + +Maps the given [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisbyte,byte,byte,byte,byte).value 'Velaptor.GameHelpers.MapValue(this byte, byte, byte, byte, byte).value') from one range to another. + +```csharp +public static byte MapValue(this byte value, byte fromStart, byte fromStop, byte toStart, byte toStop); +``` +#### Parameters + + + +`value` [System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte') + +The value to map. + + + +`fromStart` [System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte') + +The from starting range value. + + + +`fromStop` [System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte') + +The from ending range value. + + + +`toStart` [System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte') + +The to starting range value. + + + +`toStop` [System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte') + +The to ending range value. + +#### Returns +[System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte') +A value that has been mapped to a range between [toStart](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisbyte,byte,byte,byte,byte).toStart 'Velaptor.GameHelpers.MapValue(this byte, byte, byte, byte, byte).toStart') and [toStop](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisbyte,byte,byte,byte,byte).toStop 'Velaptor.GameHelpers.MapValue(this byte, byte, byte, byte, byte).toStop'). + +#### Remarks +Be careful when restricting the 'to' values to a value between 0 and 1. This will always return a value +of 0. This is because the return type is a byte and any value between the values of 0 and 1 is +a floating point value and floating point values cannot be represented with a byte data type. + +This results in a value of 0 with a loss of information. If you need to return a value that +is between the values of 0 and 1, use the method overload [MapValue(this int, float, float, float, float)](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisint,float,float,float,float) 'Velaptor.GameHelpers.MapValue(this int, float, float, float, float)'). + + + +### MapValue(this byte, float, float, float, float) + +Maps the given [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisbyte,float,float,float,float).value 'Velaptor.GameHelpers.MapValue(this byte, float, float, float, float).value') from one range to another. + +```csharp +public static float MapValue(this byte value, float fromStart, float fromStop, float toStart, float toStop); +``` +#### Parameters + + + +`value` [System.Byte](https://docs.microsoft.com/en-us/dotnet/api/System.Byte 'System.Byte') + +The value to map. + + + +`fromStart` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The from starting range value. + + + +`fromStop` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The from ending range value. + + + +`toStart` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The to starting range value. + + + +`toStop` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The to ending range value. + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +A value that has been mapped to a range between [toStart](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisbyte,float,float,float,float).toStart 'Velaptor.GameHelpers.MapValue(this byte, float, float, float, float).toStart') and [toStop](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisbyte,float,float,float,float).toStop 'Velaptor.GameHelpers.MapValue(this byte, float, float, float, float).toStop'). + + + +### MapValue(this float, float, float, float, float) + +Maps the given [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisfloat,float,float,float,float).value 'Velaptor.GameHelpers.MapValue(this float, float, float, float, float).value') from one range to another. + +```csharp +public static float MapValue(this float value, float fromStart, float fromStop, float toStart, float toStop); +``` +#### Parameters + + + +`value` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to map. + + + +`fromStart` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The from starting range value. + + + +`fromStop` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The from ending range value. + + + +`toStart` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The to starting range value. + + + +`toStop` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The to ending range value. + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +A value that has been mapped to a range between [toStart](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisfloat,float,float,float,float).toStart 'Velaptor.GameHelpers.MapValue(this float, float, float, float, float).toStart') and [toStop](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisfloat,float,float,float,float).toStop 'Velaptor.GameHelpers.MapValue(this float, float, float, float, float).toStop'). + + + +### MapValue(this int, float, float, float, float) + +Maps the given [value](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisint,float,float,float,float).value 'Velaptor.GameHelpers.MapValue(this int, float, float, float, float).value') from one range to another. + +```csharp +public static float MapValue(this int value, float fromStart, float fromStop, float toStart, float toStop); +``` +#### Parameters + + + +`value` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The value to map. + + + +`fromStart` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The from starting range value. + + + +`fromStop` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The from ending range value. + + + +`toStart` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The to starting range value. + + + +`toStop` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The to ending range value. + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +A value that has been mapped to a range between [toStart](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisint,float,float,float,float).toStart 'Velaptor.GameHelpers.MapValue(this int, float, float, float, float).toStart') and [toStop](Velaptor.GameHelpers.md#Velaptor.GameHelpers.MapValue(thisint,float,float,float,float).toStop 'Velaptor.GameHelpers.MapValue(this int, float, float, float, float).toStop'). + + + +### OnlyContainsLetters(this string) + +Returns a value indicating whether or not this string only contains letters. + +```csharp +public static bool OnlyContainsLetters(this string value); +``` +#### Parameters + + + +`value` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The string to check. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the string only contains letters. + + + +### RotateAround(this Vector2, Vector2, float, bool) + +Rotates the [vector](Velaptor.GameHelpers.md#Velaptor.GameHelpers.RotateAround(thisSystem.Numerics.Vector2,System.Numerics.Vector2,float,bool).vector 'Velaptor.GameHelpers.RotateAround(this System.Numerics.Vector2, System.Numerics.Vector2, float, bool).vector') around the [origin](Velaptor.GameHelpers.md#Velaptor.GameHelpers.RotateAround(thisSystem.Numerics.Vector2,System.Numerics.Vector2,float,bool).origin 'Velaptor.GameHelpers.RotateAround(this System.Numerics.Vector2, System.Numerics.Vector2, float, bool).origin') at the given [angle](Velaptor.GameHelpers.md#Velaptor.GameHelpers.RotateAround(thisSystem.Numerics.Vector2,System.Numerics.Vector2,float,bool).angle 'Velaptor.GameHelpers.RotateAround(this System.Numerics.Vector2, System.Numerics.Vector2, float, bool).angle'). + +```csharp +public static System.Numerics.Vector2 RotateAround(this System.Numerics.Vector2 vector, System.Numerics.Vector2 origin, float angle, bool clockWise=true); +``` +#### Parameters + + + +`vector` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The vector to rotate. + + + +`origin` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The origin to rotate the [vector](Velaptor.GameHelpers.md#Velaptor.GameHelpers.RotateAround(thisSystem.Numerics.Vector2,System.Numerics.Vector2,float,bool).vector 'Velaptor.GameHelpers.RotateAround(this System.Numerics.Vector2, System.Numerics.Vector2, float, bool).vector') around. + + + +`angle` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The angle in degrees to rotate [vector](Velaptor.GameHelpers.md#Velaptor.GameHelpers.RotateAround(thisSystem.Numerics.Vector2,System.Numerics.Vector2,float,bool).vector 'Velaptor.GameHelpers.RotateAround(this System.Numerics.Vector2, System.Numerics.Vector2, float, bool).vector'). Value must be positive. + + + +`clockWise` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +Determines the direction the given [vector](Velaptor.GameHelpers.md#Velaptor.GameHelpers.RotateAround(thisSystem.Numerics.Vector2,System.Numerics.Vector2,float,bool).vector 'Velaptor.GameHelpers.RotateAround(this System.Numerics.Vector2, System.Numerics.Vector2, float, bool).vector') should rotate around the [origin](Velaptor.GameHelpers.md#Velaptor.GameHelpers.RotateAround(thisSystem.Numerics.Vector2,System.Numerics.Vector2,float,bool).origin 'Velaptor.GameHelpers.RotateAround(this System.Numerics.Vector2, System.Numerics.Vector2, float, bool).origin'). + +#### Returns +[System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') +The [vector](Velaptor.GameHelpers.md#Velaptor.GameHelpers.RotateAround(thisSystem.Numerics.Vector2,System.Numerics.Vector2,float,bool).vector 'Velaptor.GameHelpers.RotateAround(this System.Numerics.Vector2, System.Numerics.Vector2, float, bool).vector') rotated around the [origin](Velaptor.GameHelpers.md#Velaptor.GameHelpers.RotateAround(thisSystem.Numerics.Vector2,System.Numerics.Vector2,float,bool).origin 'Velaptor.GameHelpers.RotateAround(this System.Numerics.Vector2, System.Numerics.Vector2, float, bool).origin'). + + + +### ToDegrees(this float) + +Converts the given [radians](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ToDegrees(thisfloat).radians 'Velaptor.GameHelpers.ToDegrees(this float).radians') value into degrees. + +```csharp +public static float ToDegrees(this float radians); +``` +#### Parameters + + + +`radians` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to convert. + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +The radians converted into degrees. + + + +### ToRadians(this float) + +Converts the given [degrees](Velaptor.GameHelpers.md#Velaptor.GameHelpers.ToRadians(thisfloat).degrees 'Velaptor.GameHelpers.ToRadians(this float).degrees') value into radians. + +```csharp +public static float ToRadians(this float degrees); +``` +#### Parameters + + + +`degrees` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to convert. + +#### Returns +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +The degrees converted into radians. + + + +### ToVector4(this Color) + +Converts the given [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') to a [System.Numerics.Vector4](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector4 'System.Numerics.Vector4') +with each component holding the color component values. + +```csharp +public static System.Numerics.Vector4 ToVector4(this System.Drawing.Color clr); +``` +#### Parameters + + + +`clr` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color to convert. + +#### Returns +[System.Numerics.Vector4](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector4 'System.Numerics.Vector4') +A 4 component vector of color values. +X = red. +Y = green. +Z = blue. +W = alpha. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.AtlasSubTextureData.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.AtlasSubTextureData.md new file mode 100644 index 00000000..d78421be --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.AtlasSubTextureData.md @@ -0,0 +1,58 @@ +--- +title: Velaptor.Graphics.AtlasSubTextureData +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### AtlasSubTextureData Struct + +Holds data about a texture atlas sub texture. + +```csharp +public readonly struct AtlasSubTextureData +``` +## Properties + + + +### Bounds + +Gets the bounds of the sub texture data. + +```csharp +public System.Drawing.Rectangle Bounds { get; set; } +``` + +#### Property Value +[System.Drawing.Rectangle](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Rectangle 'System.Drawing.Rectangle') + + + +### FrameIndex + +Gets the index of the sub texture frame. + +```csharp +public int FrameIndex { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +#### Remarks +This is used for frames of animation. A negative value indicates +whether or not the sub texture is part of any animation frames. + + + +### Name + +Gets the name of the sub texture. + +```csharp +public string Name { get; set; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.CircleShape.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.CircleShape.md new file mode 100644 index 00000000..5370c303 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.CircleShape.md @@ -0,0 +1,276 @@ +--- +title: Velaptor.Graphics.CircleShape +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### CircleShape Struct + +Represents a circle shape with various attributes. + +```csharp +public struct CircleShape : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[CircleShape](Velaptor.Graphics.CircleShape.md 'Velaptor.Graphics.CircleShape')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Constructors + + + +### CircleShape() Constructor + +Initializes a new instance of the [CircleShape](Velaptor.Graphics.CircleShape.md 'Velaptor.Graphics.CircleShape') struct. + +```csharp +public CircleShape(); +``` +## Properties + + + +### BorderThickness + +Gets or sets the thickness of the circle's border. + +```csharp +public float BorderThickness { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks + +Only visible if the [IsSolid](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.IsSolid 'Velaptor.Graphics.CircleShape.IsSolid') property is set to `false`. +
+The border thickness is automatically restricted to a value no greater than the [Radius](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.Radius 'Velaptor.Graphics.CircleShape.Radius'). + + + +### Bottom + +Gets or sets the bottom location of the bottom of the circle on the Y axis. + +```csharp +public float Bottom { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Will automatically update the [Position](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.Position 'Velaptor.Graphics.CircleShape.Position') of the circle. + + + +### Color + +Gets or sets the color of the circle. + +```csharp +public System.Drawing.Color Color { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +#### Remarks +Ignored if the [GradientType](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientType 'Velaptor.Graphics.CircleShape.GradientType') is set to any value other than [None](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.None 'Velaptor.Graphics.ColorGradient.None'). + + + +### Diameter + +Gets or sets the diameter of the circle. + +```csharp +public float Diameter { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +The diameter is restricted to a minimum value of one. + + + +### GradientStart + +Gets or sets the starting color of the gradient. + +```csharp +public System.Drawing.Color GradientStart { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +#### Remarks +This property is ignored if the [GradientType](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientType 'Velaptor.Graphics.CircleShape.GradientType') is set to a value of [None](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.None 'Velaptor.Graphics.ColorGradient.None'). + + + +### GradientStop + +Gets or sets the ending color of the gradient. + +```csharp +public System.Drawing.Color GradientStop { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +#### Remarks +This property is ignored if the [GradientType](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientType 'Velaptor.Graphics.CircleShape.GradientType') is set to a value of [None](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.None 'Velaptor.Graphics.ColorGradient.None'). + + + +### GradientType + +Gets or sets the type of color gradient that will be applied to the circle. + +```csharp +public Velaptor.Graphics.ColorGradient GradientType { get; set; } +``` + +#### Property Value +[ColorGradient](Velaptor.Graphics.ColorGradient.md 'Velaptor.Graphics.ColorGradient') + +#### Remarks + +A value of [None](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.None 'Velaptor.Graphics.ColorGradient.None') will use the [Color](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.Color 'Velaptor.Graphics.CircleShape.Color') +property and render the circle with a solid color. + +A value of [Horizontal](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.Horizontal 'Velaptor.Graphics.ColorGradient.Horizontal') will ignore the [Color](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.Color 'Velaptor.Graphics.CircleShape.Color') +property and use the [GradientStart](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientStart 'Velaptor.Graphics.CircleShape.GradientStart')[GradientStop](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientStop 'Velaptor.Graphics.CircleShape.GradientStop') properties. +This will render the circle with [GradientStart](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientStart 'Velaptor.Graphics.CircleShape.GradientStart') color on the left side and gradually +render it to the right side as the [GradientStop](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientStop 'Velaptor.Graphics.CircleShape.GradientStop') color. + +A value of [Vertical](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.Vertical 'Velaptor.Graphics.ColorGradient.Vertical') will ignore the [Color](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.Color 'Velaptor.Graphics.CircleShape.Color') +property and use the [GradientStart](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientStart 'Velaptor.Graphics.CircleShape.GradientStart') and [GradientStop](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientStop 'Velaptor.Graphics.CircleShape.GradientStop') properties. +This will render the circle with [GradientStart](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientStart 'Velaptor.Graphics.CircleShape.GradientStart') color on the top and gradually +render it to the bottom as the [GradientStop](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.GradientStop 'Velaptor.Graphics.CircleShape.GradientStop') color. + + + +### IsSolid + +Gets or sets a value indicating whether or not the circle is solid. + +```csharp +public bool IsSolid { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Left + +Gets or sets the location of the left side of the circle on the X axis. + +```csharp +public float Left { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Will automatically update the [Position](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.Position 'Velaptor.Graphics.CircleShape.Position') of the circle. + + + +### Position + +Gets or sets the position of the circle. + +```csharp +public System.Numerics.Vector2 Position { get; set; } +``` + +#### Property Value +[System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +#### Remarks +This position is relative to the center of the circle. + + + +### Radius + +Gets or sets the radius of the circle. + +```csharp +public float Radius { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +This is half of the [Diameter](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.Diameter 'Velaptor.Graphics.CircleShape.Diameter'). +
+Changing the radius will automatically update the [Diameter](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.Diameter 'Velaptor.Graphics.CircleShape.Diameter'). + + + +### Right + +Gets or sets the location of the right side of the circle on the X axis. + +```csharp +public float Right { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Will automatically update the [Position](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.Position 'Velaptor.Graphics.CircleShape.Position') of the circle. + + + +### Top + +Gets or sets the top location of the top of the circle on the Y axis. + +```csharp +public float Top { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Will automatically update the [Position](Velaptor.Graphics.CircleShape.md#Velaptor.Graphics.CircleShape.Position 'Velaptor.Graphics.CircleShape.Position') of the circle. +## Methods + + + +### Empty() + +Empties the struct. + +```csharp +public void Empty(); +``` + + + +### IsEmpty() + +Returns a value indicating whether or not the [RectShape](Velaptor.Graphics.RectShape.md 'Velaptor.Graphics.RectShape') struct is empty. + +```csharp +public bool IsEmpty(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +True if empty. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ColorGradient.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ColorGradient.md new file mode 100644 index 00000000..2f82b321 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ColorGradient.md @@ -0,0 +1,33 @@ +--- +title: Velaptor.Graphics.ColorGradient +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +## ColorGradient Enum + +Represents the type of gradient a color can. + +```csharp +public enum ColorGradient +``` +#### Fields + + + +`Horizontal` 1 + +A horizontal gradient is applied. + + + +`None` 0 + +No gradient is applied. + + + +`Vertical` 2 + +A vertical gradient is applied. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.CornerRadius.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.CornerRadius.md new file mode 100644 index 00000000..b8529a96 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.CornerRadius.md @@ -0,0 +1,260 @@ +--- +title: Velaptor.Graphics.CornerRadius +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### CornerRadius Struct + +Holds all of the radius values for each corner of a rectangle. + +```csharp +public readonly struct CornerRadius : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Constructors + + + +### CornerRadius(float, float, float, float) Constructor + +Initializes a new instance of the [CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') struct. + +```csharp +public CornerRadius(float topLeft, float bottomLeft, float bottomRight, float topRight); +``` +#### Parameters + + + +`topLeft` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The top left corner radius. + + + +`bottomLeft` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The bottom left corner radius. + + + +`bottomRight` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The bottom right corner radius. + + + +`topRight` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The top right corner radius. + + + +### CornerRadius(float) Constructor + +Initializes a new instance of the [CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') struct. + +```csharp +public CornerRadius(float value); +``` +#### Parameters + + + +`value` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to set all corner radius values. +## Properties + + + +### BottomLeft + +Gets the bottom left corner radius. + +```csharp +public float BottomLeft { get; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### BottomRight + +Gets the bottom right corner radius. + +```csharp +public float BottomRight { get; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### TopLeft + +Gets the top left corner radius. + +```csharp +public float TopLeft { get; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### TopRight + +Gets the top right corner radius. + +```csharp +public float TopRight { get; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +## Methods + + + +### Empty() + +Returns an empty [CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') instance. + +```csharp +public static Velaptor.Graphics.CornerRadius Empty(); +``` + +#### Returns +[CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') +The empty instance. + + + +### IsEmpty() + +Returns a value indicating if the [CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') is empty. + +```csharp +public bool IsEmpty(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +True if empty. + + + +### SetBottomLeft(CornerRadius, float) + +Sets the bottom left corner value of the given [cornerRadius](Velaptor.Graphics.CornerRadius.md#Velaptor.Graphics.CornerRadius.SetBottomLeft(Velaptor.Graphics.CornerRadius,float).cornerRadius 'Velaptor.Graphics.CornerRadius.SetBottomLeft(Velaptor.Graphics.CornerRadius, float).cornerRadius') to the given [value](Velaptor.Graphics.CornerRadius.md#Velaptor.Graphics.CornerRadius.SetBottomLeft(Velaptor.Graphics.CornerRadius,float).value 'Velaptor.Graphics.CornerRadius.SetBottomLeft(Velaptor.Graphics.CornerRadius, float).value'). + +```csharp +public static Velaptor.Graphics.CornerRadius SetBottomLeft(Velaptor.Graphics.CornerRadius cornerRadius, float value); +``` +#### Parameters + + + +`cornerRadius` [CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') + +The corner radius to change. + + + +`value` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to set. + +#### Returns +[CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') +The corner radius with the updated value. + + + +### SetBottomRight(CornerRadius, float) + +Sets the bottom right corner value of the given [cornerRadius](Velaptor.Graphics.CornerRadius.md#Velaptor.Graphics.CornerRadius.SetBottomRight(Velaptor.Graphics.CornerRadius,float).cornerRadius 'Velaptor.Graphics.CornerRadius.SetBottomRight(Velaptor.Graphics.CornerRadius, float).cornerRadius') to the given [value](Velaptor.Graphics.CornerRadius.md#Velaptor.Graphics.CornerRadius.SetBottomRight(Velaptor.Graphics.CornerRadius,float).value 'Velaptor.Graphics.CornerRadius.SetBottomRight(Velaptor.Graphics.CornerRadius, float).value'). + +```csharp +public static Velaptor.Graphics.CornerRadius SetBottomRight(Velaptor.Graphics.CornerRadius cornerRadius, float value); +``` +#### Parameters + + + +`cornerRadius` [CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') + +The corner radius to change. + + + +`value` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to set. + +#### Returns +[CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') +The corner radius with the updated value. + + + +### SetTopLeft(CornerRadius, float) + +Sets the top left corner value of the given [cornerRadius](Velaptor.Graphics.CornerRadius.md#Velaptor.Graphics.CornerRadius.SetTopLeft(Velaptor.Graphics.CornerRadius,float).cornerRadius 'Velaptor.Graphics.CornerRadius.SetTopLeft(Velaptor.Graphics.CornerRadius, float).cornerRadius') to the given [value](Velaptor.Graphics.CornerRadius.md#Velaptor.Graphics.CornerRadius.SetTopLeft(Velaptor.Graphics.CornerRadius,float).value 'Velaptor.Graphics.CornerRadius.SetTopLeft(Velaptor.Graphics.CornerRadius, float).value'). + +```csharp +public static Velaptor.Graphics.CornerRadius SetTopLeft(Velaptor.Graphics.CornerRadius cornerRadius, float value); +``` +#### Parameters + + + +`cornerRadius` [CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') + +The corner radius to change. + + + +`value` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to set. + +#### Returns +[CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') +The corner radius with the updated value. + + + +### SetTopRight(CornerRadius, float) + +Sets the top right corner value of the given [cornerRadius](Velaptor.Graphics.CornerRadius.md#Velaptor.Graphics.CornerRadius.SetTopRight(Velaptor.Graphics.CornerRadius,float).cornerRadius 'Velaptor.Graphics.CornerRadius.SetTopRight(Velaptor.Graphics.CornerRadius, float).cornerRadius') to the given [value](Velaptor.Graphics.CornerRadius.md#Velaptor.Graphics.CornerRadius.SetTopRight(Velaptor.Graphics.CornerRadius,float).value 'Velaptor.Graphics.CornerRadius.SetTopRight(Velaptor.Graphics.CornerRadius, float).value'). + +```csharp +public static Velaptor.Graphics.CornerRadius SetTopRight(Velaptor.Graphics.CornerRadius cornerRadius, float value); +``` +#### Parameters + + + +`cornerRadius` [CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') + +The corner radius to change. + + + +`value` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The value to set. + +#### Returns +[CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') +The corner radius with the updated value. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.GlyphMetrics.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.GlyphMetrics.md new file mode 100644 index 00000000..23592c91 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.GlyphMetrics.md @@ -0,0 +1,343 @@ +--- +title: Velaptor.Graphics.GlyphMetrics +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### GlyphMetrics Struct + +Holds all of the various metrics of a glyph for rendering purposes. + +```csharp +public struct GlyphMetrics : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Properties + + + +### Ascender + +Gets or sets the vertical distance from the horizontal baseline to the highest 'character' +coordinate in a font face. + +```csharp +public float Ascender { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Unfortunately, font formats don't define the ascender in a +uniform way. For some formats, it represents the ascent of all capital Latin characters +(without accents). For others it is the ascent of the highest accented character. Finally, +other formats define it as being equal to Y max value of the global bounding box. + + + +### CharIndex + +Gets or sets the glyph index. + +```csharp +public uint CharIndex { get; set; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +#### Remarks +The value of 0 means โ€˜undefined character codeโ€™. + + + +### Descender + +Gets or sets the vertical distance from the horizontal baseline to the lowest โ€˜characterโ€™ coordinate in a font face. + +```csharp +public float Descender { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Unfortunately, font formats don't define the descender in a uniform way. For some formats, +it represents the descent of all capital Latin characters (without accents). For others it is +the ascent of the lowest accented character. Finally, other formats define it as being equal +to the Y min value of the global bounding box. This field is negative for values below the baseline. + + + +### Glyph + +Gets or sets the glyph character. + +```csharp +public char Glyph { get; set; } +``` + +#### Property Value +[System.Char](https://docs.microsoft.com/en-us/dotnet/api/System.Char 'System.Char') + + + +### GlyphBounds + +Gets or sets the rectangular bounds of where in a font texture +atlas the given [Glyph](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.Glyph 'Velaptor.Graphics.GlyphMetrics.Glyph') resides. + +```csharp +public System.Drawing.RectangleF GlyphBounds { get; set; } +``` + +#### Property Value +[System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF') + + + +### GlyphHeight + +Gets or sets the glyph's height. + +```csharp +public float GlyphHeight { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### GlyphWidth + +Gets or sets the glyph's width. + +```csharp +public float GlyphWidth { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### HoriBearingX + +Gets or sets the horizontal distance from the current cursor position to +the leftmost border of the glyph image's bounding box. + +```csharp +public float HoriBearingX { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### HoriBearingY + +Gets or sets the vertical distance from the current cursor position +(on the baseline) to the top most border of the glyph image's bounding box. + +```csharp +public float HoriBearingY { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### HorizontalAdvance + +Gets or sets the horizontal distance to increment the pen position when the glyph +is drawn as part of a string of text. + +```csharp +public float HorizontalAdvance { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### XMax + +Gets or sets the horizontal maximum (right-most). + +```csharp +public float XMax { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### XMin + +Gets or sets the horizontal minimum (left-most). + +```csharp +public float XMin { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### YMax + +Gets or sets the vertical maximum (top-most). + +```csharp +public float YMax { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### YMin + +Gets or sets the vertical minimum (bottom-most). + +```csharp +public float YMin { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') +## Methods + + + +### Equals(object) + +Determines whether the specified object is equal to the current object. + +```csharp +public override bool Equals(object? obj); +``` +#### Parameters + + + +`obj` [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') + +The object to compare with the current object. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +[true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') if the specified object is equal to the current object; otherwise, [false](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'). + + + +### Equals(GlyphMetrics) + +Defines a generalized method that a value type or class implements to create a type-specific method for determining equality of instances. + +```csharp +public bool Equals(Velaptor.Graphics.GlyphMetrics other); +``` +#### Parameters + + + +`other` [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### GetHashCode() + +Returns the hash code for this instance. + +```csharp +public override int GetHashCode(); +``` + +#### Returns +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +A 32-bit signed integer that is the hash code for this instance. + + + +### ToString() + +Returns the fully qualified type name of this instance. + +```csharp +public override string ToString(); +``` + +#### Returns +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The fully qualified type name. +### Operators + + + +## GlyphMetrics.operator ==(GlyphMetrics, GlyphMetrics) Operator + +Returns a value indicating whether or not the [left](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.op_Equality(Velaptor.Graphics.GlyphMetrics,Velaptor.Graphics.GlyphMetrics).left 'Velaptor.Graphics.GlyphMetrics.op_Equality(Velaptor.Graphics.GlyphMetrics, Velaptor.Graphics.GlyphMetrics).left') operand is equal to the [right](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.op_Equality(Velaptor.Graphics.GlyphMetrics,Velaptor.Graphics.GlyphMetrics).right 'Velaptor.Graphics.GlyphMetrics.op_Equality(Velaptor.Graphics.GlyphMetrics, Velaptor.Graphics.GlyphMetrics).right') operand. + +```csharp +public static bool operator ==(Velaptor.Graphics.GlyphMetrics left, Velaptor.Graphics.GlyphMetrics right); +``` +#### Parameters + + + +`left` [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics') + +The left operand compared with the right operand. + + + +`right` [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics') + +The right operand compared with the left operand. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +True if both operands are equal. + + + +## GlyphMetrics.operator !=(GlyphMetrics, GlyphMetrics) Operator + +Returns a value indicating whether or not the [left](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.op_Inequality(Velaptor.Graphics.GlyphMetrics,Velaptor.Graphics.GlyphMetrics).left 'Velaptor.Graphics.GlyphMetrics.op_Inequality(Velaptor.Graphics.GlyphMetrics, Velaptor.Graphics.GlyphMetrics).left') operand is not equal to the [right](Velaptor.Graphics.GlyphMetrics.md#Velaptor.Graphics.GlyphMetrics.op_Inequality(Velaptor.Graphics.GlyphMetrics,Velaptor.Graphics.GlyphMetrics).right 'Velaptor.Graphics.GlyphMetrics.op_Inequality(Velaptor.Graphics.GlyphMetrics, Velaptor.Graphics.GlyphMetrics).right') operand. + +```csharp +public static bool operator !=(Velaptor.Graphics.GlyphMetrics left, Velaptor.Graphics.GlyphMetrics right); +``` +#### Parameters + + + +`left` [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics') + +The left operand compared with the right operand. + + + +`right` [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics') + +The right operand compared with the left operand. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +True if both operands are not equal. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IImageLoader.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IImageLoader.md new file mode 100644 index 00000000..d5d5e6d5 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IImageLoader.md @@ -0,0 +1,39 @@ +--- +title: Velaptor.Graphics.IImageLoader +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### IImageLoader Interface + +Loads images from disk. + +```csharp +public interface IImageLoader +``` + +Derived +↳ [ImageLoader](Velaptor.Graphics.ImageLoader.md 'Velaptor.Graphics.ImageLoader') +## Methods + + + +### LoadImage(string) + +Loads an image from the specified file path. + +```csharp +Velaptor.Graphics.ImageData LoadImage(string filePath); +``` +#### Parameters + + + +`filePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The path to the image file. + +#### Returns +[ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData') +The image data. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IRenderContext.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IRenderContext.md new file mode 100644 index 00000000..ba6d52f3 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IRenderContext.md @@ -0,0 +1,58 @@ +--- +title: Velaptor.Graphics.IRenderContext +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### IRenderContext Interface + +Represents where and how rendering will occur. + +```csharp +public interface IRenderContext +``` +## Methods + + + +### GetRenderAreaSize() + +Gets the current size of the rendering area. + +```csharp +System.Drawing.Size GetRenderAreaSize(); +``` + +#### Returns +[System.Drawing.Size](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Size 'System.Drawing.Size') +The render area size. + +#### Remarks +This is synonymous with the OpenGL viewport. + + + +### SetRenderAreaSize(int, int) + +Sets the size of the rendering area. + +```csharp +void SetRenderAreaSize(int width, int height); +``` +#### Parameters + + + +`width` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The width in pixels of the area. + + + +`height` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The height in pixels of the area. + +#### Remarks +This is synonymous with the OpenGL viewport. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IRenderMediator.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IRenderMediator.md new file mode 100644 index 00000000..ab348de4 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.IRenderMediator.md @@ -0,0 +1,14 @@ +--- +title: Velaptor.Graphics.IRenderMediator +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### IRenderMediator Interface + +Manages rendering between the different renderers. + +```csharp +public interface IRenderMediator +``` \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ImageData.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ImageData.md new file mode 100644 index 00000000..81e03fce --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ImageData.md @@ -0,0 +1,261 @@ +--- +title: Velaptor.Graphics.ImageData +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### ImageData Struct + +Holds image data such as the pixel colors for each X and Y location, the image width, and height. + +```csharp +public readonly struct ImageData : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Constructors + + + +### ImageData(Color[,], uint, uint, string) Constructor + +Initializes a new instance of the [ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData') struct. + +```csharp +public ImageData(System.Drawing.Color[,]? pixels, uint width, uint height, string filePath=""); +``` +#### Parameters + + + +`pixels` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') + +The pixel data of the image. + + + +`width` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The width of the image. + + + +`height` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The height of the image. + + + +`filePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The file path of where the image exists. + +#### Remarks +The [filePath](Velaptor.Graphics.ImageData.md#Velaptor.Graphics.ImageData.ImageData(System.Drawing.Color[,],uint,uint,string).filePath 'Velaptor.Graphics.ImageData.ImageData(System.Drawing.Color[,], uint, uint, string).filePath') is used for reference only. +## Properties + + + +### FilePath + +Gets the file path of the image. + +```csharp +public string FilePath { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +#### Remarks +This is only for reference. + + + +### Height + +Gets the height of the image. + +```csharp +public uint Height { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### IsFlippedHorizontally + +Gets a value indicating whether or not the image is flipped horizontally. + +```csharp +public bool IsFlippedHorizontally { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### IsFlippedVertically + +Gets a value indicating whether or not the image is flipped vertically. + +```csharp +public bool IsFlippedVertically { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Pixels + +Gets the pixel colors of the image. + +```csharp +public System.Drawing.Color[,] Pixels { get; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') + +#### Remarks +The first dimension is the X location of the pixel and the second +dimension is the Y location of the pixel. + +The 32-bit color component byte layout is ARGB. + + + +### Width + +Gets the width of the image. + +```csharp +public uint Width { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') +## Methods + + + +### DrawImage(ImageData, Point) + +Draws the given [image](Velaptor.Graphics.ImageData.md#Velaptor.Graphics.ImageData.DrawImage(Velaptor.Graphics.ImageData,System.Drawing.Point).image 'Velaptor.Graphics.ImageData.DrawImage(Velaptor.Graphics.ImageData, System.Drawing.Point).image') onto this image, +starting at the given [location](Velaptor.Graphics.ImageData.md#Velaptor.Graphics.ImageData.DrawImage(Velaptor.Graphics.ImageData,System.Drawing.Point).location 'Velaptor.Graphics.ImageData.DrawImage(Velaptor.Graphics.ImageData, System.Drawing.Point).location'). + +```csharp +public Velaptor.Graphics.ImageData DrawImage(Velaptor.Graphics.ImageData image, System.Drawing.Point location); +``` +#### Parameters + + + +`image` [ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData') + +The image to draw onto this one. + + + +`location` [System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + +The location of where to draw the image. +References the top left corner of the given [image](Velaptor.Graphics.ImageData.md#Velaptor.Graphics.ImageData.DrawImage(Velaptor.Graphics.ImageData,System.Drawing.Point).image 'Velaptor.Graphics.ImageData.DrawImage(Velaptor.Graphics.ImageData, System.Drawing.Point).image'). + +#### Returns +[ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData') +This current image with the given [image](Velaptor.Graphics.ImageData.md#Velaptor.Graphics.ImageData.DrawImage(Velaptor.Graphics.ImageData,System.Drawing.Point).image 'Velaptor.Graphics.ImageData.DrawImage(Velaptor.Graphics.ImageData, System.Drawing.Point).image') painted onto it. + +#### Remarks +If a pixel of the given [image](Velaptor.Graphics.ImageData.md#Velaptor.Graphics.ImageData.DrawImage(Velaptor.Graphics.ImageData,System.Drawing.Point).image 'Velaptor.Graphics.ImageData.DrawImage(Velaptor.Graphics.ImageData, System.Drawing.Point).image') is out side of the bounds of this +image, it will be skipped. + + + +### Equals(ImageData) + +Returns a value indicating whether or not this instance is equal to the given [ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData'). + +```csharp +public bool Equals(Velaptor.Graphics.ImageData other); +``` +#### Parameters + + + +`other` [ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData') + +The other data to compare. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if equal. + + + +### FlipHorizontally() + +Flips the image horizontally. + +```csharp +public void FlipHorizontally(); +``` + + + +### FlipVertically() + +Flips the image vertically. + +```csharp +public void FlipVertically(); +``` + + + +### GetHashCode() + +Returns the hash code for this instance. + +```csharp +public override int GetHashCode(); +``` + +#### Returns +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +A 32-bit signed integer that is the hash code for this instance. + + + +### IsEmpty() + +Returns a value indicating whether or not the [ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData') contents are empty. + +```csharp +public bool IsEmpty(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if empty. + + + +### ToString() + +Returns the fully qualified type name of this instance. + +```csharp +public override string ToString(); +``` + +#### Returns +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The fully qualified type name. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ImageLoader.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ImageLoader.md new file mode 100644 index 00000000..8e7224d5 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.ImageLoader.md @@ -0,0 +1,60 @@ +--- +title: Velaptor.Graphics.ImageLoader +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### ImageLoader Class + +Loads images from disk. + +```csharp +public class ImageLoader : +Velaptor.Graphics.IImageLoader +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ ImageLoader + +Implements [IImageLoader](Velaptor.Graphics.IImageLoader.md 'Velaptor.Graphics.IImageLoader') +## Constructors + + + +### ImageLoader() Constructor + +Initializes a new instance of the [ImageLoader](Velaptor.Graphics.ImageLoader.md 'Velaptor.Graphics.ImageLoader') class. + +```csharp +public ImageLoader(); +``` +## Methods + + + +### LoadImage(string) + + + +```csharp +public Velaptor.Graphics.ImageData LoadImage(string filePath); +``` +#### Parameters + + + +`filePath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The relative or absolute file path to the image. + +Implements [LoadImage(string)](Velaptor.Graphics.IImageLoader.md#Velaptor.Graphics.IImageLoader.LoadImage(string) 'Velaptor.Graphics.IImageLoader.LoadImage(string)') + +#### Returns +[ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData') +The image data. + +#### Remarks +If the [filePath](Velaptor.Graphics.ImageLoader.md#Velaptor.Graphics.ImageLoader.LoadImage(string).filePath 'Velaptor.Graphics.ImageLoader.LoadImage(string).filePath') is a relative path, it will be resolved +to the content directory of the application. +
+The default content directory is Content/Graphics/. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Line.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Line.md new file mode 100644 index 00000000..6d9e7480 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Line.md @@ -0,0 +1,187 @@ +--- +title: Velaptor.Graphics.Line +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### Line Struct + +Represents a single line segment. + +```csharp +public struct Line +``` +## Constructors + + + +### Line(Vector2, Vector2, float) Constructor + +Initializes a new instance of the [Line](Velaptor.Graphics.Line.md 'Velaptor.Graphics.Line') struct. + +```csharp +public Line(System.Numerics.Vector2 p1, System.Numerics.Vector2 p2, float thickness); +``` +#### Parameters + + + +`p1` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The starting point of the line. + + + +`p2` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The ending point of the line. + + + +`thickness` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The thickness of the line. + + + +### Line(Vector2, Vector2, Color, float) Constructor + +Initializes a new instance of the [Line](Velaptor.Graphics.Line.md 'Velaptor.Graphics.Line') struct. + +```csharp +public Line(System.Numerics.Vector2 p1, System.Numerics.Vector2 p2, System.Drawing.Color color, float thickness); +``` +#### Parameters + + + +`p1` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The starting point of the line. + + + +`p2` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The ending point of the line. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color of the line. + + + +`thickness` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The thickness of the line. + + + +### Line(Vector2, Vector2, Color) Constructor + +Initializes a new instance of the [Line](Velaptor.Graphics.Line.md 'Velaptor.Graphics.Line') struct. + +```csharp +public Line(System.Numerics.Vector2 p1, System.Numerics.Vector2 p2, System.Drawing.Color color); +``` +#### Parameters + + + +`p1` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The starting point of the line. + + + +`p2` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The ending point of the line. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color of the line. + + + +### Line(Vector2, Vector2) Constructor + +Initializes a new instance of the [Line](Velaptor.Graphics.Line.md 'Velaptor.Graphics.Line') struct. + +```csharp +public Line(System.Numerics.Vector2 p1, System.Numerics.Vector2 p2); +``` +#### Parameters + + + +`p1` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The starting point of the line. + + + +`p2` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The ending point of the line. +## Properties + + + +### Color + +Gets or sets the color of the line. + +```csharp +public System.Drawing.Color Color { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### P1 + +Gets or sets the starting point of the line. + +```csharp +public System.Numerics.Vector2 P1 { get; set; } +``` + +#### Property Value +[System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + + + +### P2 + +Gets or sets the ending point of the line. + +```csharp +public System.Numerics.Vector2 P2 { get; set; } +``` + +#### Property Value +[System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + + + +### Thickness + +Gets or sets the thickness of the line. + +```csharp +public float Thickness { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Restricts the thickness to a minimum value of 1. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.RectShape.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.RectShape.md new file mode 100644 index 00000000..77f1696e --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.RectShape.md @@ -0,0 +1,340 @@ +--- +title: Velaptor.Graphics.RectShape +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +#### RectShape Struct + +Represents a rectangular shape with various attributes. + +```csharp +public struct RectShape : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[RectShape](Velaptor.Graphics.RectShape.md 'Velaptor.Graphics.RectShape')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Constructors + + + +### RectShape() Constructor + +Initializes a new instance of the [RectShape](Velaptor.Graphics.RectShape.md 'Velaptor.Graphics.RectShape') struct. + +```csharp +public RectShape(); +``` +## Properties + + + +### BorderThickness + +Gets or sets the thickness of the rectangle's border. + +```csharp +public float BorderThickness { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks + +Ignored if the [IsSolid](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.IsSolid 'Velaptor.Graphics.RectShape.IsSolid') property is set to `true`. + +The value of a corner will never be larger than the smallest half [Width](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Width 'Velaptor.Graphics.RectShape.Width') or half [Height](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Height 'Velaptor.Graphics.RectShape.Height'). + + + +### Bottom + +Gets or sets the location of the bottom of the rectangle on the Y axis. + +```csharp +public float Bottom { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Will automatically update the [Position](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Position 'Velaptor.Graphics.RectShape.Position') of the rectangle. + + + +### Color + +Gets or sets the color of the rectangle. + +```csharp +public System.Drawing.Color Color { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +#### Remarks +Ignored if the [GradientType](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientType 'Velaptor.Graphics.RectShape.GradientType') is set to any value other than [None](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.None 'Velaptor.Graphics.ColorGradient.None'). + + + +### CornerRadius + +Gets or sets the radius of each corner of the rectangle. + +```csharp +public Velaptor.Graphics.CornerRadius CornerRadius { get; set; } +``` + +#### Property Value +[CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') + +#### Remarks +The value of a corner will never be larger than the smallest half [Width](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Width 'Velaptor.Graphics.RectShape.Width') or half [Height](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Height 'Velaptor.Graphics.RectShape.Height'). + + + +### GradientStart + +Gets or sets the starting color of the gradient. + +```csharp +public System.Drawing.Color GradientStart { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +#### Remarks +This property is ignored if the [GradientType](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientType 'Velaptor.Graphics.RectShape.GradientType') is set to a value of [None](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.None 'Velaptor.Graphics.ColorGradient.None'). + + + +### GradientStop + +Gets or sets the ending color of the gradient. + +```csharp +public System.Drawing.Color GradientStop { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +#### Remarks +This property is ignored if the [GradientType](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientType 'Velaptor.Graphics.RectShape.GradientType') is set to a value of [None](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.None 'Velaptor.Graphics.ColorGradient.None'). + + + +### GradientType + +Gets or sets the type of color gradient that will be applied to the rectangle. + +```csharp +public Velaptor.Graphics.ColorGradient GradientType { get; set; } +``` + +#### Property Value +[ColorGradient](Velaptor.Graphics.ColorGradient.md 'Velaptor.Graphics.ColorGradient') + +#### Remarks + +A value of [None](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.None 'Velaptor.Graphics.ColorGradient.None') will use the [Color](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Color 'Velaptor.Graphics.RectShape.Color') +property and render the rectangle with a solid color. + +A value of [Horizontal](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.Horizontal 'Velaptor.Graphics.ColorGradient.Horizontal') will ignore the [Color](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Color 'Velaptor.Graphics.RectShape.Color') +property and use the [GradientStart](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientStart 'Velaptor.Graphics.RectShape.GradientStart')[GradientStop](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientStop 'Velaptor.Graphics.RectShape.GradientStop') properties. +This will render the rectangle with [GradientStart](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientStart 'Velaptor.Graphics.RectShape.GradientStart') color on the left side and gradually +render it to the right side as the [GradientStop](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientStop 'Velaptor.Graphics.RectShape.GradientStop') color. + +A value of [Vertical](Velaptor.Graphics.ColorGradient.md#Velaptor.Graphics.ColorGradient.Vertical 'Velaptor.Graphics.ColorGradient.Vertical') will ignore the [Color](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Color 'Velaptor.Graphics.RectShape.Color') +property and use the [GradientStart](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientStart 'Velaptor.Graphics.RectShape.GradientStart') and [GradientStop](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientStop 'Velaptor.Graphics.RectShape.GradientStop') properties. +This will render the rectangle with [GradientStart](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientStart 'Velaptor.Graphics.RectShape.GradientStart') color on the top and gradually +render it to the bottom as the [GradientStop](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.GradientStop 'Velaptor.Graphics.RectShape.GradientStop') color. + + + +### HalfHeight + +Gets the half height of the rectangle. + +```csharp +public float HalfHeight { get; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### HalfWidth + +Gets the half width of the rectangle. + +```csharp +public float HalfWidth { get; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### Height + +Gets or sets the height of the rectangle. + +```csharp +public float Height { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +The height is restricted to a minimum value of one. + + + +### IsSolid + +Gets or sets a value indicating whether or not the rectangle is solid. + +```csharp +public bool IsSolid { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Left + +Gets or sets the location of the left side of the rectangle on the X axis. + +```csharp +public float Left { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Will automatically update the [Position](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Position 'Velaptor.Graphics.RectShape.Position') of the rectangle. + + + +### Position + +Gets or sets the position of the rectangle. + +```csharp +public System.Numerics.Vector2 Position { get; set; } +``` + +#### Property Value +[System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +#### Remarks +This position is the center of the rectangle. + + + +### Right + +Gets or sets the location of the right side of the rectangle on the X axis. + +```csharp +public float Right { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Will automatically update the [Position](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Position 'Velaptor.Graphics.RectShape.Position') of the rectangle. + + + +### Top + +Gets or sets the location of the top of the rectangle on the Y axis. + +```csharp +public float Top { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +Will automatically update the [Position](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Position 'Velaptor.Graphics.RectShape.Position') of the rectangle. + + + +### Width + +Gets or sets the width of the rectangle. + +```csharp +public float Width { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +The width is restricted to a minimum value of one. +## Methods + + + +### Contains(Vector2) + +Returns a value indicating whether or not the given [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') is contained within the rectangle shape. + +```csharp +public bool Contains(System.Numerics.Vector2 vector); +``` +#### Parameters + + + +`vector` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The possibly contained [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2'). + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the [vector](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Contains(System.Numerics.Vector2).vector 'Velaptor.Graphics.RectShape.Contains(System.Numerics.Vector2).vector') is contained. + +#### Remarks +The [Left](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Left 'Velaptor.Graphics.RectShape.Left') or [Right](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Right 'Velaptor.Graphics.RectShape.Right') or [Top](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Top 'Velaptor.Graphics.RectShape.Top') or [Bottom](Velaptor.Graphics.RectShape.md#Velaptor.Graphics.RectShape.Bottom 'Velaptor.Graphics.RectShape.Bottom') are inclusive. + + + +### Empty() + +Empties the struct. + +```csharp +public void Empty(); +``` + + + +### IsEmpty() + +Returns a value indicating whether or not the [RectShape](Velaptor.Graphics.RectShape.md 'Velaptor.Graphics.RectShape') struct is empty. + +```csharp +public bool IsEmpty(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +True if empty. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.RenderEffects.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.RenderEffects.md new file mode 100644 index 00000000..2c7709ad --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.RenderEffects.md @@ -0,0 +1,39 @@ +--- +title: Velaptor.Graphics.RenderEffects +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics](Velaptor.Graphics.md 'Velaptor.Graphics') + +## RenderEffects Enum + +Adds basic effects to a texture when rendered. + +```csharp +public enum RenderEffects +``` +#### Fields + + + +`FlipBothDirections` 3 + +The texture is flipped horizontally and vertically. + + + +`FlipHorizontally` 1 + +The texture is flipped horizontally. + + + +`FlipVertically` 2 + +The texture is flipped vertically. + + + +`None` 0 + +No effects are applied. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.Exceptions.RendererException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.Exceptions.RendererException.md new file mode 100644 index 00000000..b69974b4 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.Exceptions.RendererException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Graphics.Renderers.Exceptions.RendererException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics.Renderers.Exceptions](Velaptor.Graphics.Renderers.Exceptions.md 'Velaptor.Graphics.Renderers.Exceptions') + +#### RendererException Class + +Thrown when there is a renderer type of issue. + +```csharp +public sealed class RendererException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ RendererException +## Constructors + + + +### RendererException() Constructor + +Initializes a new instance of the [RendererException](Velaptor.Graphics.Renderers.Exceptions.RendererException.md 'Velaptor.Graphics.Renderers.Exceptions.RendererException') class. + +```csharp +public RendererException(); +``` + + + +### RendererException(string, Exception) Constructor + +Initializes a new instance of the [RendererException](Velaptor.Graphics.Renderers.Exceptions.RendererException.md 'Velaptor.Graphics.Renderers.Exceptions.RendererException') class. + +```csharp +public RendererException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### RendererException(string) Constructor + +Initializes a new instance of the [RendererException](Velaptor.Graphics.Renderers.Exceptions.RendererException.md 'Velaptor.Graphics.Renderers.Exceptions.RendererException') class. + +```csharp +public RendererException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.Exceptions.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.Exceptions.md new file mode 100644 index 00000000..7a79c5e1 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.Exceptions.md @@ -0,0 +1,11 @@ +--- +title: Velaptor.Graphics.Renderers.Exceptions +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Graphics.Renderers.Exceptions Namespace + +| Classes | | +| :--- | :--- | +| [RendererException](Velaptor.Graphics.Renderers.Exceptions.RendererException.md 'Velaptor.Graphics.Renderers.Exceptions.RendererException') | Thrown when there is a renderer type of issue. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.IFontRenderer.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.IFontRenderer.md new file mode 100644 index 00000000..a89578c2 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.IFontRenderer.md @@ -0,0 +1,746 @@ +--- +title: Velaptor.Graphics.Renderers.IFontRenderer +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics.Renderers](Velaptor.Graphics.Renderers.md 'Velaptor.Graphics.Renderers') + +#### IFontRenderer Interface + +Renders text to the screen using a particular font. + +```csharp +public interface IFontRenderer +``` +## Methods + + + +### Render(IFont, string, int, int, float, float, int) + +Renders the given [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).text') using the given [font](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).font 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).font') +at the position determined by the given [x](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).x 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).x') and [y](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).y 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).y') coordinates. + +```csharp +void Render(Velaptor.Content.Fonts.IFont font, string text, int x, int y, float renderSize, float angle, int layer=0); +``` +#### Parameters + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + +The font to use for rendering the [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).text'). + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to render. + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The X coordinate location to render the text. + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The Y coordinate location to render the text. + + + +`renderSize` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The size of the text. + + + +`angle` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The angle of the text in degrees. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the text. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [x](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).x 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).x') and [y](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).y 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).y') position is based on the center of the text. +The center of the text is based on the furthest most left, right, top, and bottom edges of the text. + +The [renderSize](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).renderSize 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).renderSize') is a value between 0 and 1. Using the value 1 represents the text being rendered +at the standard size of 100%. Example: Using 1.5 would represent 150% or 50% larger than the normal size. + +Lower [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(IFont, string, int, int, float, float, Color, int) + +Renders the given [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).text') using the given [font](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).font 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).font') +at the position determined by the given [x](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).x 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).x') and [y](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).y 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).y') coordinates, +with the given [angle](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).angle 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).angle'), [renderSize](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).renderSize 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).renderSize'), and [color](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).color 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).color'). + +```csharp +void Render(Velaptor.Content.Fonts.IFont font, string text, int x, int y, float renderSize, float angle, System.Drawing.Color color, int layer=0); +``` +#### Parameters + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + +The font to use for rendering the [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).text'). + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to render. + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The X coordinate location to render the text. + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The Y coordinate location to render the text. + + + +`renderSize` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The size of the text. + + + +`angle` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The angle of the text in degrees. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color to apply to the rendering. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the text. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [x](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).x 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).x') and [y](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).y 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).y') position is based on the center of the text. +The center of the text is based on the furthest most left, right, top, and bottom edges of the text. + +The [renderSize](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).renderSize 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).renderSize') is a value between 0 and 1. Using the value 1 represents the text being rendered +at the standard size of 100%. Example: Using 1.5 would represent 150% or 50% larger than the normal size. + +Lower [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,float,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, float, System.Drawing.Color, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(IFont, string, int, int, float, Color, int) + +Renders the given [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).text') using the given [font](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).font 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).font') +at the position determined by the given [x](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).x 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).x') and [y](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).y 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).y') coordinates, +with the given [angle](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).angle 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).angle'), and [color](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).color 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).color'). + +```csharp +void Render(Velaptor.Content.Fonts.IFont font, string text, int x, int y, float angle, System.Drawing.Color color, int layer=0); +``` +#### Parameters + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + +The font to use for rendering the [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).text'). + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to render. + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The X coordinate location to render the text. + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The Y coordinate location to render the text. + + + +`angle` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The angle of the text in degrees. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color to apply to the rendering. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the text. + +#### Remarks + +The [x](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).x 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).x') and [y](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).y 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).y') position is based on the center of the text. +The center of the text is based on the furthest most left, right, top, and bottom edges of the text. + +Lower [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,float,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, float, System.Drawing.Color, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(IFont, string, int, int, int) + +Renders the given [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, int).text') using the given [font](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,int).font 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, int).font') +at the position determined by the given [x](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,int).x 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, int).x') and [y](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,int).y 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, int).y') coordinates. + +```csharp +void Render(Velaptor.Content.Fonts.IFont font, string text, int x, int y, int layer=0); +``` +#### Parameters + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + +The font to use for rendering the [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, int).text'). + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to render. + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The X coordinate location to render the text. + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The Y coordinate location to render the text. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the text. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [x](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,int).x 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, int).x') and [y](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,int).y 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, int).y') position is based on the center of the text. +The center of the text is based on the furthest most left, right, top, and bottom edges of the text. + +Lower [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(IFont, string, int, int, Color, int) + +Renders the given [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).text') using the given [font](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).font 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).font') +at the position determined by the given [x](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).x 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).x') and [y](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).y 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).y') coordinates +and [color](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).color 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).color'). + +```csharp +void Render(Velaptor.Content.Fonts.IFont font, string text, int x, int y, System.Drawing.Color color, int layer=0); +``` +#### Parameters + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + +The font to use for rendering the [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).text'). + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to render. + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The X coordinate location to render the text. + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The Y coordinate location to render the text. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color of the text. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the text. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [x](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).x 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).x') and [y](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).y 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).y') position is based on the center of the text. +The center of the text is based on the furthest most left, right, top, and bottom edges of the text. + +The size is a value between 0 and 1. Using the value 1 represents the text being rendered +at the standard size of 100%. Example: Using 1.5 would represent 150% or 50% larger than the normal size. + +Lower [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,int,int,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, int, int, System.Drawing.Color, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(IFont, string, Vector2, float, float, int) + +Renders the given [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).text') using the given [font](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).font 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).font') +at the given [position](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).position 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).position'), with the given [renderSize](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).renderSize 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).renderSize'), and [angle](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).angle 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).angle'). + +```csharp +void Render(Velaptor.Content.Fonts.IFont font, string text, System.Numerics.Vector2 position, float renderSize, float angle, int layer=0); +``` +#### Parameters + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + +The font to use for rendering the [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).text'). + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to render. + + + +`position` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The position to render the text. + + + +`renderSize` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The size of the text. + + + +`angle` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The angle of the text in degrees. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the text. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [position](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).position 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).position') is based on the center of the text. +The center of the text is based on the furthest most left, right, top, and bottom edges of the text. + +The [renderSize](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).renderSize 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).renderSize') is a value between 0 and 1. Using the value 1 represents the text being rendered +at the standard size of 100%. Example: Using 1.5 would represent 150% or 50% larger than the normal size. + +Lower [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,float,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, float, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(IFont, string, Vector2, float, Color, int) + +Renders the given [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,System.Drawing.Color,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, System.Drawing.Color, int).text') using the given [font](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,System.Drawing.Color,int).font 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, System.Drawing.Color, int).font') +at the given [position](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,System.Drawing.Color,int).position 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, System.Drawing.Color, int).position'), [angle](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,System.Drawing.Color,int).angle 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, System.Drawing.Color, int).angle'), and [color](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,System.Drawing.Color,int).color 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, System.Drawing.Color, int).color'). + +```csharp +void Render(Velaptor.Content.Fonts.IFont font, string text, System.Numerics.Vector2 position, float angle, System.Drawing.Color color, int layer=0); +``` +#### Parameters + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + +The font to use for rendering the [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,System.Drawing.Color,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, System.Drawing.Color, int).text'). + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to render. + + + +`position` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The position to render the text. + + + +`angle` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The angle of the text in degrees. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color of the text. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the text. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [position](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,System.Drawing.Color,int).position 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, System.Drawing.Color, int).position') is based on the center of the text. +The center of the text is based on the furthest most left, right, top, and bottom edges of the text. + +Lower [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, System.Drawing.Color, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, System.Drawing.Color, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,float,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, float, System.Drawing.Color, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(IFont, string, Vector2, int) + +Renders the given [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, int).text') using the given [font](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,int).font 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, int).font') +and [position](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,int).position 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, int).position'). + +```csharp +void Render(Velaptor.Content.Fonts.IFont font, string text, System.Numerics.Vector2 position, int layer=0); +``` +#### Parameters + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + +The font to use for rendering the [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, int).text'). + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to render. + + + +`position` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The position to render the text. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the text. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [position](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,int).position 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, int).position') is based on the center of the text. +The center of the text is based on the furthest most left, right, top, and bottom edges of the text. + +Lower [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(IFont, string, Vector2, Color, int) + +Renders the given [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,System.Drawing.Color,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, System.Drawing.Color, int).text') using the given [font](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,System.Drawing.Color,int).font 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, System.Drawing.Color, int).font') +at the given [position](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,System.Drawing.Color,int).position 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, System.Drawing.Color, int).position') with the given [color](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,System.Drawing.Color,int).color 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, System.Drawing.Color, int).color'). + +```csharp +void Render(Velaptor.Content.Fonts.IFont font, string text, System.Numerics.Vector2 position, System.Drawing.Color color, int layer=0); +``` +#### Parameters + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + +The font to use for rendering the [text](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,System.Drawing.Color,int).text 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, System.Drawing.Color, int).text'). + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text to render. + + + +`position` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The position to render the text. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color of the text. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the text. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [position](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,System.Drawing.Color,int).position 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, System.Drawing.Color, int).position') is based on the center of the text. +The center of the text is based on the furthest most left, right, top, and bottom edges of the text. + +Lower [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, System.Drawing.Color, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, System.Drawing.Color, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IFontRenderer.md#Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont,string,System.Numerics.Vector2,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.IFontRenderer.Render(Velaptor.Content.Fonts.IFont, string, System.Numerics.Vector2, System.Drawing.Color, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(IFont, Span<(GlyphMetrics metrics,Color clr)>, int, int, float, float, int) + +```csharp +void Render(Velaptor.Content.Fonts.IFont font, System.Span<(Velaptor.Graphics.GlyphMetrics metrics,System.Drawing.Color clr)> charMetrics, int x, int y, float renderSize, float angle, int layer=0); +``` +#### Parameters + + + +`font` [IFont](Velaptor.Content.Fonts.IFont.md 'Velaptor.Content.Fonts.IFont') + + + +`charMetrics` [System.Span<](https://docs.microsoft.com/en-us/dotnet/api/System.Span-1 'System.Span`1')[<](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics')[,](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color')[>](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Span-1 'System.Span`1') + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +`renderSize` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +`angle` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.ILineRenderer.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.ILineRenderer.md new file mode 100644 index 00000000..83145c38 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.ILineRenderer.md @@ -0,0 +1,306 @@ +--- +title: Velaptor.Graphics.Renderers.ILineRenderer +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics.Renderers](Velaptor.Graphics.Renderers.md 'Velaptor.Graphics.Renderers') + +#### ILineRenderer Interface + +Renders lines to the screen. + +```csharp +public interface ILineRenderer +``` +## Methods + + + +### Render(Line, int) + +Renders the given [line](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.Render(Velaptor.Graphics.Line,int).line 'Velaptor.Graphics.Renderers.ILineRenderer.Render(Velaptor.Graphics.Line, int).line'). + +```csharp +void Render(Velaptor.Graphics.Line line, int layer=0); +``` +#### Parameters + + + +`line` [Line](Velaptor.Graphics.Line.md 'Velaptor.Graphics.Line') + +The line to render. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the line. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +Lower [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.Render(Velaptor.Graphics.Line,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.Render(Velaptor.Graphics.Line, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.Render(Velaptor.Graphics.Line,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.Render(Velaptor.Graphics.Line, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.Render(Velaptor.Graphics.Line,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.Render(Velaptor.Graphics.Line, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### RenderLine(Vector2, Vector2, int) + +Renders a line using the given [start](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,int).start 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, int).start') and [end](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,int).end 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, int).end') vectors on the given [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, int).layer'). + +```csharp +void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, int layer=0); +``` +#### Parameters + + + +`start` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The start of the line. + + + +`end` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The end of the line. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the line. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +Lower [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### RenderLine(Vector2, Vector2, Color, int) + +Renders a line using the given [start](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,int).start 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, int).start') and [end](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,int).end 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, int).end') vectors on the given [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, int).layer') +using the given [color](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,int).color 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, int).color'). + +```csharp +void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, System.Drawing.Color color, int layer=0); +``` +#### Parameters + + + +`start` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The start of the line. + + + +`end` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The end of the line. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color of the line. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the line. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +Lower [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### RenderLine(Vector2, Vector2, Color, uint, int) + +Renders a line using the given [start](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,uint,int).start 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, uint, int).start') and [end](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,uint,int).end 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, uint, int).end') vectors on the given [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,uint,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, uint, int).layer') +using the given [color](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,uint,int).color 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, uint, int).color') and line [thickness](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,uint,int).thickness 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, uint, int).thickness'). + +```csharp +void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, System.Drawing.Color color, uint thickness, int layer=0); +``` +#### Parameters + + + +`start` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The start of the line. + + + +`end` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The end of the line. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color of the line. + + + +`thickness` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The thickness of the line. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the line. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +Lower [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,uint,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, uint, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,uint,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, uint, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,System.Drawing.Color,uint,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, System.Drawing.Color, uint, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### RenderLine(Vector2, Vector2, uint, int) + +Renders a line using the given [start](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,uint,int).start 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, uint, int).start') and [end](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,uint,int).end 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, uint, int).end') vectors on the given [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,uint,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, uint, int).layer') +using the given line [thickness](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,uint,int).thickness 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, uint, int).thickness'). + +```csharp +void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, uint thickness, int layer=0); +``` +#### Parameters + + + +`start` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The start of the line. + + + +`end` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The end of the line. + + + +`thickness` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The thickness of the line. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the line. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +Lower [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,uint,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, uint, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,uint,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, uint, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ILineRenderer.md#Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2,System.Numerics.Vector2,uint,int).layer 'Velaptor.Graphics.Renderers.ILineRenderer.RenderLine(System.Numerics.Vector2, System.Numerics.Vector2, uint, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.IShapeRenderer.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.IShapeRenderer.md new file mode 100644 index 00000000..8cd0dfd0 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.IShapeRenderer.md @@ -0,0 +1,111 @@ +--- +title: Velaptor.Graphics.Renderers.IShapeRenderer +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics.Renderers](Velaptor.Graphics.Renderers.md 'Velaptor.Graphics.Renderers') + +#### IShapeRenderer Interface + +Renders rectangles to the screen. + +```csharp +public interface IShapeRenderer +``` +## Methods + + + +### Render(CircleShape, int) + +Renders the given [circle](Velaptor.Graphics.Renderers.IShapeRenderer.md#Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.CircleShape,int).circle 'Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.CircleShape, int).circle'). + +```csharp +void Render(Velaptor.Graphics.CircleShape circle, int layer=0); +``` +#### Parameters + + + +`circle` [CircleShape](Velaptor.Graphics.CircleShape.md 'Velaptor.Graphics.CircleShape') + +The circle to render. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the circle. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +Lower [layer](Velaptor.Graphics.Renderers.IShapeRenderer.md#Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.CircleShape,int).layer 'Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.CircleShape, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IShapeRenderer.md#Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.CircleShape,int).layer 'Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.CircleShape, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IShapeRenderer.md#Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.CircleShape,int).layer 'Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.CircleShape, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(RectShape, int) + +Renders the given [rect](Velaptor.Graphics.Renderers.IShapeRenderer.md#Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.RectShape,int).rect 'Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.RectShape, int).rect'). + +```csharp +void Render(Velaptor.Graphics.RectShape rect, int layer=0); +``` +#### Parameters + + + +`rect` [RectShape](Velaptor.Graphics.RectShape.md 'Velaptor.Graphics.RectShape') + +The rectangle to render. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the rectangle. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +Lower [layer](Velaptor.Graphics.Renderers.IShapeRenderer.md#Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.RectShape,int).layer 'Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.RectShape, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.IShapeRenderer.md#Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.RectShape,int).layer 'Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.RectShape, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.IShapeRenderer.md#Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.RectShape,int).layer 'Velaptor.Graphics.Renderers.IShapeRenderer.Render(Velaptor.Graphics.RectShape, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.ITextureRenderer.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.ITextureRenderer.md new file mode 100644 index 00000000..e0b4b5e4 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.ITextureRenderer.md @@ -0,0 +1,751 @@ +--- +title: Velaptor.Graphics.Renderers.ITextureRenderer +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Graphics.Renderers](Velaptor.Graphics.Renderers.md 'Velaptor.Graphics.Renderers') + +#### ITextureRenderer Interface + +Renders textures to the screen. + +```csharp +public interface ITextureRenderer +``` +## Methods + + + +### Render(ITexture, int, int, float, int) + +Renders the given texture at the given [x](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,float,int).x 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, float, int).x') and [y](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,float,int).y 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, float, int).y') coordinates and the given [angle](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,float,int).angle 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, float, int).angle'). + +```csharp +void Render(Velaptor.Content.ITexture texture, int x, int y, float angle, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The X location of the texture. + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The Y location of the texture. + + + +`angle` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The angle of rotation in degrees of the rendering. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [x](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,float,int).x 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, float, int).x') and [y](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,float,int).y 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, float, int).y') position are based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,float,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, float, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,float,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, float, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,float,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, float, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(ITexture, int, int, int) + +Renders the given texture at the given [x](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,int).x 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, int).x') and [y](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,int).y 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, int).y') coordinates. + +```csharp +void Render(Velaptor.Content.ITexture texture, int x, int y, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The X location of the texture. + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The Y location of the texture. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [x](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,int).x 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, int).x') and [y](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,int).y 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, int).y') position are based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(ITexture, int, int, Color, int) + +Renders the given texture at the given [x](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,int).x 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, int).x') and [y](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,int).y 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, int).y') coordinates. + +```csharp +void Render(Velaptor.Content.ITexture texture, int x, int y, System.Drawing.Color color, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The X location of the texture. + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The Y location of the texture. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color to apply to the texture. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [x](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,int).x 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, int).x') and [y](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,int).y 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, int).y') position is based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(ITexture, int, int, Color, RenderEffects, int) + +Renders the given texture at the given [x](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).x 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).x') and [y](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).y 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).y') coordinates. + +```csharp +void Render(Velaptor.Content.ITexture texture, int x, int y, System.Drawing.Color color, Velaptor.Graphics.RenderEffects effects, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The X location of the texture. + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The Y location of the texture. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color to apply to the texture. + + + +`effects` [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') + +The rendering effects to apply to the texture when rendering. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [x](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).x 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).x') and [y](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).y 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).y') position is based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(ITexture, int, int, RenderEffects, int) + +Renders the given texture at the given [x](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,Velaptor.Graphics.RenderEffects,int).x 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, Velaptor.Graphics.RenderEffects, int).x') and [y](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,Velaptor.Graphics.RenderEffects,int).y 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, Velaptor.Graphics.RenderEffects, int).y') coordinates. + +```csharp +void Render(Velaptor.Content.ITexture texture, int x, int y, Velaptor.Graphics.RenderEffects effects, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`x` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The X location of the texture. + + + +`y` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The Y location of the texture. + + + +`effects` [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') + +The rendering effects to apply to the texture when rendering. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [x](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,Velaptor.Graphics.RenderEffects,int).x 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, Velaptor.Graphics.RenderEffects, int).x') and [y](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,Velaptor.Graphics.RenderEffects,int).y 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, Velaptor.Graphics.RenderEffects, int).y') position is based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, Velaptor.Graphics.RenderEffects, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, Velaptor.Graphics.RenderEffects, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,int,int,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, int, int, Velaptor.Graphics.RenderEffects, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(ITexture, Rectangle, Rectangle, float, float, Color, RenderEffects, int) + +Renders the given [Texture](Velaptor.Content.Texture.md 'Velaptor.Content.Texture') using the given parameters. + +```csharp +void Render(Velaptor.Content.ITexture texture, System.Drawing.Rectangle srcRect, System.Drawing.Rectangle destRect, float size, float angle, System.Drawing.Color color, Velaptor.Graphics.RenderEffects effects, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`srcRect` [System.Drawing.Rectangle](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Rectangle 'System.Drawing.Rectangle') + +The rectangle of the sub texture within the texture to render. + + + +`destRect` [System.Drawing.Rectangle](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Rectangle 'System.Drawing.Rectangle') + +The destination rectangle of rendering. + + + +`size` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The size to render the texture. 1 is for 100%/normal size. + + + +`angle` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The angle of rotation in degrees of the rendering. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color to apply to the rendering. + + + +`effects` [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') + +The rendering effects to apply to the texture when rendering. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The position in the [destRect](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Drawing.Rectangle,System.Drawing.Rectangle,float,float,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).destRect 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Drawing.Rectangle, System.Drawing.Rectangle, float, float, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).destRect') is based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Drawing.Rectangle,System.Drawing.Rectangle,float,float,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Drawing.Rectangle, System.Drawing.Rectangle, float, float, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Drawing.Rectangle,System.Drawing.Rectangle,float,float,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Drawing.Rectangle, System.Drawing.Rectangle, float, float, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Drawing.Rectangle,System.Drawing.Rectangle,float,float,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Drawing.Rectangle, System.Drawing.Rectangle, float, float, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(ITexture, Vector2, float, int) + +Renders the given texture at the given [pos](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,float,int).pos 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, float, int).pos') coordinates and the given [angle](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,float,int).angle 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, float, int).angle'). + +```csharp +void Render(Velaptor.Content.ITexture texture, System.Numerics.Vector2 pos, float angle, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`pos` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The location of the texture. + + + +`angle` [System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +The angle of rotation in degrees of the rendering. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [pos](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,float,int).pos 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, float, int).pos') position are based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,float,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, float, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,float,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, float, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,float,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, float, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(ITexture, Vector2, int) + +Renders the given texture at the given [pos](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,int).pos 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, int).pos') coordinates. + +```csharp +void Render(Velaptor.Content.ITexture texture, System.Numerics.Vector2 pos, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`pos` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The location of the texture. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [pos](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,int).pos 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, int).pos') position are based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(ITexture, Vector2, Color, int) + +Renders the given texture at the given [pos](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,System.Drawing.Color,int).pos 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, System.Drawing.Color, int).pos') coordinates. + +```csharp +void Render(Velaptor.Content.ITexture texture, System.Numerics.Vector2 pos, System.Drawing.Color color, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`pos` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The location of the texture. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color to apply to the texture. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [pos](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,System.Drawing.Color,int).pos 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, System.Drawing.Color, int).pos') position are based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, System.Drawing.Color, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, System.Drawing.Color, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,System.Drawing.Color,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, System.Drawing.Color, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(ITexture, Vector2, Color, RenderEffects, int) + +Renders the given texture at the given [pos](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).pos 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).pos') coordinates. + +```csharp +void Render(Velaptor.Content.ITexture texture, System.Numerics.Vector2 pos, System.Drawing.Color color, Velaptor.Graphics.RenderEffects effects, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`pos` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The location of the texture. + + + +`color` [System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + +The color to apply to the texture. + + + +`effects` [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') + +The rendering effects to apply to the texture when rendering. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [pos](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).pos 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).pos') position are based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,System.Drawing.Color,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, System.Drawing.Color, Velaptor.Graphics.RenderEffects, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 + + + +### Render(ITexture, Vector2, RenderEffects, int) + +Renders the given texture at the given [pos](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,Velaptor.Graphics.RenderEffects,int).pos 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, Velaptor.Graphics.RenderEffects, int).pos') coordinates. + +```csharp +void Render(Velaptor.Content.ITexture texture, System.Numerics.Vector2 pos, Velaptor.Graphics.RenderEffects effects, int layer=0); +``` +#### Parameters + + + +`texture` [ITexture](Velaptor.Content.ITexture.md 'Velaptor.Content.ITexture') + +The texture to render. + + + +`pos` [System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + +The location of the texture. + + + +`effects` [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') + +The rendering effects to apply to the texture when rendering. + + + +`layer` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + +The layer to render the texture. + +#### Exceptions + +[System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') +Thrown if the [Begin()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Begin() 'Velaptor.Batching.IBatcher.Begin()') method has not been called. + +#### Remarks + +The [pos](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,Velaptor.Graphics.RenderEffects,int).pos 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, Velaptor.Graphics.RenderEffects, int).pos') position are based on the center of the texture. + +Lower [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, Velaptor.Graphics.RenderEffects, int).layer') values will render before higher [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, Velaptor.Graphics.RenderEffects, int).layer') values. +If two separate textures have the same [layer](Velaptor.Graphics.Renderers.ITextureRenderer.md#Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture,System.Numerics.Vector2,Velaptor.Graphics.RenderEffects,int).layer 'Velaptor.Graphics.Renderers.ITextureRenderer.Render(Velaptor.Content.ITexture, System.Numerics.Vector2, Velaptor.Graphics.RenderEffects, int).layer') value, they will +render in the order that the method was invoked. + +Example below:Render Method Invoked Order: +1. Texture 1 (Layer -10) +2. Texture 2 (Layer -20) +3. Texture 3 (Layer 0) +4. Texture 4 (Layer 0) +5. Texture 5 (Layer 4) +6. Texture 6 (Layer 3)Texture Render Order: +- Texture 2 +- Texture 1 +- Texture 3 +- Texture 4 +- Texture 6 +- Texture 5 \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.md new file mode 100644 index 00000000..091c5240 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.Renderers.md @@ -0,0 +1,14 @@ +--- +title: Velaptor.Graphics.Renderers +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Graphics.Renderers Namespace + +| Interfaces | | +| :--- | :--- | +| [IFontRenderer](Velaptor.Graphics.Renderers.IFontRenderer.md 'Velaptor.Graphics.Renderers.IFontRenderer') | Renders text to the screen using a particular font. | +| [ILineRenderer](Velaptor.Graphics.Renderers.ILineRenderer.md 'Velaptor.Graphics.Renderers.ILineRenderer') | Renders lines to the screen. | +| [IShapeRenderer](Velaptor.Graphics.Renderers.IShapeRenderer.md 'Velaptor.Graphics.Renderers.IShapeRenderer') | Renders rectangles to the screen. | +| [ITextureRenderer](Velaptor.Graphics.Renderers.ITextureRenderer.md 'Velaptor.Graphics.Renderers.ITextureRenderer') | Renders textures to the screen. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.md new file mode 100644 index 00000000..d217edd4 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Graphics.md @@ -0,0 +1,32 @@ +--- +title: Velaptor.Graphics +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Graphics Namespace + +| Classes | | +| :--- | :--- | +| [ImageLoader](Velaptor.Graphics.ImageLoader.md 'Velaptor.Graphics.ImageLoader') | Loads images from disk. | + +| Structs | | +| :--- | :--- | +| [AtlasSubTextureData](Velaptor.Graphics.AtlasSubTextureData.md 'Velaptor.Graphics.AtlasSubTextureData') | Holds data about a texture atlas sub texture. | +| [CircleShape](Velaptor.Graphics.CircleShape.md 'Velaptor.Graphics.CircleShape') | Represents a circle shape with various attributes. | +| [CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') | Holds all of the radius values for each corner of a rectangle. | +| [GlyphMetrics](Velaptor.Graphics.GlyphMetrics.md 'Velaptor.Graphics.GlyphMetrics') | Holds all of the various metrics of a glyph for rendering purposes. | +| [ImageData](Velaptor.Graphics.ImageData.md 'Velaptor.Graphics.ImageData') | Holds image data such as the pixel colors for each X and Y location, the image width, and height. | +| [Line](Velaptor.Graphics.Line.md 'Velaptor.Graphics.Line') | Represents a single line segment. | +| [RectShape](Velaptor.Graphics.RectShape.md 'Velaptor.Graphics.RectShape') | Represents a rectangular shape with various attributes. | + +| Interfaces | | +| :--- | :--- | +| [IImageLoader](Velaptor.Graphics.IImageLoader.md 'Velaptor.Graphics.IImageLoader') | Loads images from disk. | +| [IRenderContext](Velaptor.Graphics.IRenderContext.md 'Velaptor.Graphics.IRenderContext') | Represents where and how rendering will occur. | +| [IRenderMediator](Velaptor.Graphics.IRenderMediator.md 'Velaptor.Graphics.IRenderMediator') | Manages rendering between the different renderers. | + +| Enums | | +| :--- | :--- | +| [ColorGradient](Velaptor.Graphics.ColorGradient.md 'Velaptor.Graphics.ColorGradient') | Represents the type of gradient a color can. | +| [RenderEffects](Velaptor.Graphics.RenderEffects.md 'Velaptor.Graphics.RenderEffects') | Adds basic effects to a texture when rendered. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Hardware.SystemDisplay.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Hardware.SystemDisplay.md new file mode 100644 index 00000000..e1bcd1fa --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Hardware.SystemDisplay.md @@ -0,0 +1,191 @@ +--- +title: Velaptor.Hardware.SystemDisplay +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Hardware](Velaptor.Hardware.md 'Velaptor.Hardware') + +#### SystemDisplay Struct + +Holds information about a single display in the system. + +```csharp +public readonly struct SystemDisplay : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[SystemDisplay](Velaptor.Hardware.SystemDisplay.md 'Velaptor.Hardware.SystemDisplay')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Constructors + + + +### SystemDisplay() Constructor + +Initializes a new instance of the [SystemDisplay](Velaptor.Hardware.SystemDisplay.md 'Velaptor.Hardware.SystemDisplay') class. + +```csharp +public SystemDisplay(); +``` +## Properties + + + +### BlueBitDepth + +Gets the bit depth of the blue color channel in the current video mode. + +```csharp +public int BlueBitDepth { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Center + +Gets the center location of the display. + +```csharp +public System.Numerics.Vector2 Center { get; } +``` + +#### Property Value +[System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + + + +### GreenBitDepth + +Gets the bit depth of the green color channel in the current video mode. + +```csharp +public int GreenBitDepth { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Height + +Gets the height in screen coordinates in the current video mode. + +```csharp +public int Height { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### HorizontalDPI + +Gets the approximate dpi of the display on the horizontal axis. + +```csharp +public float HorizontalDPI { get; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### HorizontalScale + +Gets the scale of the display on the horizontal axis. + +```csharp +public float HorizontalScale { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +If the display was set to a scale of 150%, this value of 1.5 should be used. + + + +### IsMain + +Gets a value indicating whether or not the display is the primary display in the system. + +```csharp +public bool IsMain { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### RedBitDepth + +Gets the bit depth of the red color channel in the current video mode. + +```csharp +public int RedBitDepth { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### RefreshRate + +Gets the refresh rate in Hz in the current video mode. + +```csharp +public int RefreshRate { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### VerticalDPI + +Gets the approximate dpi of the display on the vertical axis. + +```csharp +public float VerticalDPI { get; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### VerticalScale + +Gets the scale of the display on the vertical axis. + +```csharp +public float VerticalScale { get; set; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + +#### Remarks +If the display was set to a scale of 150%, this value of 1.5 should be used. + + + +### Width + +Gets the width in screen coordinates in the current video mode. + +```csharp +public int Width { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Hardware.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Hardware.md new file mode 100644 index 00000000..56f8d66b --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Hardware.md @@ -0,0 +1,11 @@ +--- +title: Velaptor.Hardware +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Hardware Namespace + +| Structs | | +| :--- | :--- | +| [SystemDisplay](Velaptor.Hardware.SystemDisplay.md 'Velaptor.Hardware.SystemDisplay') | Holds information about a single display in the system. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.IDrawable.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.IDrawable.md new file mode 100644 index 00000000..cfdf86a0 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.IDrawable.md @@ -0,0 +1,32 @@ +--- +title: Velaptor.IDrawable +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +#### IDrawable Interface + +Provides the ability for an object to be rendered. + +```csharp +public interface IDrawable +``` + +Derived +↳ [IScene](Velaptor.Scene.IScene.md 'Velaptor.Scene.IScene') +↳ [ISceneManager](Velaptor.Scene.ISceneManager.md 'Velaptor.Scene.ISceneManager') +↳ [SceneBase](Velaptor.Scene.SceneBase.md 'Velaptor.Scene.SceneBase') +↳ [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase') +↳ [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') +## Methods + + + +### Render() + +Renders the object. + +```csharp +void Render(); +``` \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.IPlatform.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.IPlatform.md new file mode 100644 index 00000000..99860d69 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.IPlatform.md @@ -0,0 +1,57 @@ +--- +title: Velaptor.IPlatform +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +#### IPlatform Interface + +Represents the current platform. + +```csharp +public interface IPlatform +``` + +Derived +↳ [Platform](Velaptor.Platform.md 'Velaptor.Platform') +## Properties + + + +### CurrentPlatform + +Gets the current platform of the system. + +```csharp +System.Runtime.InteropServices.OSPlatform CurrentPlatform { get; } +``` + +#### Property Value +[System.Runtime.InteropServices.OSPlatform](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.InteropServices.OSPlatform 'System.Runtime.InteropServices.OSPlatform') + + + +### Is32BitProcess + +Gets a value indicating whether or not the system is a 32 bit process. + +```csharp +bool Is32BitProcess { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Is64BitProcess + +Gets a value indicating whether or not the system is a 64 bit process. + +```csharp +bool Is64BitProcess { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.IUpdatable.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.IUpdatable.md new file mode 100644 index 00000000..cc031e5b --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.IUpdatable.md @@ -0,0 +1,39 @@ +--- +title: Velaptor.IUpdatable +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +#### IUpdatable Interface + +Provides the ability for an object to be updated. + +```csharp +public interface IUpdatable +``` + +Derived +↳ [IScene](Velaptor.Scene.IScene.md 'Velaptor.Scene.IScene') +↳ [ISceneManager](Velaptor.Scene.ISceneManager.md 'Velaptor.Scene.ISceneManager') +↳ [SceneBase](Velaptor.Scene.SceneBase.md 'Velaptor.Scene.SceneBase') +↳ [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase') +↳ [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') +## Methods + + + +### Update(FrameTime) + +Updates the object. + +```csharp +void Update(Velaptor.FrameTime frameTime); +``` +#### Parameters + + + +`frameTime` [FrameTime](Velaptor.FrameTime.md 'Velaptor.FrameTime') + +The amount of time that has passed for the current frame. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.InvalidInputException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.InvalidInputException.md new file mode 100644 index 00000000..060fdf90 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.InvalidInputException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Input.Exceptions.InvalidInputException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Input.Exceptions](Velaptor.Input.Exceptions.md 'Velaptor.Input.Exceptions') + +#### InvalidInputException Class + +Occurs when invalid input has occured. + +```csharp +public sealed class InvalidInputException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ InvalidInputException +## Constructors + + + +### InvalidInputException() Constructor + +Initializes a new instance of the [InvalidInputException](Velaptor.Input.Exceptions.InvalidInputException.md 'Velaptor.Input.Exceptions.InvalidInputException') class. + +```csharp +public InvalidInputException(); +``` + + + +### InvalidInputException(string, Exception) Constructor + +Initializes a new instance of the [InvalidInputException](Velaptor.Input.Exceptions.InvalidInputException.md 'Velaptor.Input.Exceptions.InvalidInputException') class. + +```csharp +public InvalidInputException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### InvalidInputException(string) Constructor + +Initializes a new instance of the [InvalidInputException](Velaptor.Input.Exceptions.InvalidInputException.md 'Velaptor.Input.Exceptions.InvalidInputException') class. + +```csharp +public InvalidInputException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.NoKeyboardException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.NoKeyboardException.md new file mode 100644 index 00000000..135c26b1 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.NoKeyboardException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Input.Exceptions.NoKeyboardException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Input.Exceptions](Velaptor.Input.Exceptions.md 'Velaptor.Input.Exceptions') + +#### NoKeyboardException Class + +Occurs when a keyboard has not been detected in the system. + +```csharp +public sealed class NoKeyboardException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ NoKeyboardException +## Constructors + + + +### NoKeyboardException() Constructor + +Initializes a new instance of the [NoKeyboardException](Velaptor.Input.Exceptions.NoKeyboardException.md 'Velaptor.Input.Exceptions.NoKeyboardException') class. + +```csharp +public NoKeyboardException(); +``` + + + +### NoKeyboardException(string, Exception) Constructor + +Initializes a new instance of the [NoKeyboardException](Velaptor.Input.Exceptions.NoKeyboardException.md 'Velaptor.Input.Exceptions.NoKeyboardException') class. + +```csharp +public NoKeyboardException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### NoKeyboardException(string) Constructor + +Initializes a new instance of the [NoKeyboardException](Velaptor.Input.Exceptions.NoKeyboardException.md 'Velaptor.Input.Exceptions.NoKeyboardException') class. + +```csharp +public NoKeyboardException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.NoMouseException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.NoMouseException.md new file mode 100644 index 00000000..2e3c70d2 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.NoMouseException.md @@ -0,0 +1,67 @@ +--- +title: Velaptor.Input.Exceptions.NoMouseException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Input.Exceptions](Velaptor.Input.Exceptions.md 'Velaptor.Input.Exceptions') + +#### NoMouseException Class + +Occurs when a mouse has not been detected in the system. + +```csharp +public sealed class NoMouseException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ NoMouseException +## Constructors + + + +### NoMouseException() Constructor + +Initializes a new instance of the [NoMouseException](Velaptor.Input.Exceptions.NoMouseException.md 'Velaptor.Input.Exceptions.NoMouseException') class. + +```csharp +public NoMouseException(); +``` + + + +### NoMouseException(string, Exception) Constructor + +Initializes a new instance of the [NoMouseException](Velaptor.Input.Exceptions.NoMouseException.md 'Velaptor.Input.Exceptions.NoMouseException') class. + +```csharp +public NoMouseException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. + + + +### NoMouseException(string) Constructor + +Initializes a new instance of the [NoMouseException](Velaptor.Input.Exceptions.NoMouseException.md 'Velaptor.Input.Exceptions.NoMouseException') class. + +```csharp +public NoMouseException(string message); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.md new file mode 100644 index 00000000..0583146c --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.Exceptions.md @@ -0,0 +1,13 @@ +--- +title: Velaptor.Input.Exceptions +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Input.Exceptions Namespace + +| Classes | | +| :--- | :--- | +| [InvalidInputException](Velaptor.Input.Exceptions.InvalidInputException.md 'Velaptor.Input.Exceptions.InvalidInputException') | Occurs when invalid input has occured. | +| [NoKeyboardException](Velaptor.Input.Exceptions.NoKeyboardException.md 'Velaptor.Input.Exceptions.NoKeyboardException') | Occurs when a keyboard has not been detected in the system. | +| [NoMouseException](Velaptor.Input.Exceptions.NoMouseException.md 'Velaptor.Input.Exceptions.NoMouseException') | Occurs when a mouse has not been detected in the system. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.IAppInput_TState_.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.IAppInput_TState_.md new file mode 100644 index 00000000..5bcdedeb --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.IAppInput_TState_.md @@ -0,0 +1,37 @@ +--- +title: Velaptor.Input.IAppInput +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Input](Velaptor.Input.md 'Velaptor.Input') + +#### IAppInput<TState> Interface + +Gets the state of game-specific input such as a mouse or keyboard. + +```csharp +public interface IAppInput + where TState : struct, System.ValueType, System.ValueType +``` +#### Type parameters + + + +`TState` + +The state of the input. +## Methods + + + +### GetState() + +Returns the current state of the input. + +```csharp +TState GetState(); +``` + +#### Returns +[TState](Velaptor.Input.IAppInput_TState_.md#Velaptor.Input.IAppInput_TState_.TState 'Velaptor.Input.IAppInput.TState') +The state of the input. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyCode.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyCode.md new file mode 100644 index 00000000..3a36c529 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyCode.md @@ -0,0 +1,730 @@ +--- +title: Velaptor.Input.KeyCode +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Input](Velaptor.Input.md 'Velaptor.Input') + +## KeyCode Enum + +Specifies key codes and modifiers in US keyboard layout. + +```csharp +public enum KeyCode +``` +#### Fields + + + +`A` 65 + +The A key. + + + +`Apostrophe` 39 + +The apostrophe key. + + + +`B` 66 + +The B key. + + + +`Backslash` 92 + +The backslash. + + + +`Backspace` 259 + +F + The backspace key. + + + +`C` 67 + +The C key. + + + +`CapsLock` 280 + +The caps lock key. + + + +`Comma` 44 + +The comma key. + + + +`D` 68 + +The D key. + + + +`D0` 48 + +The 0 key. + + + +`D1` 49 + +The 1 key. + + + +`D2` 50 + +The 2 key. + + + +`D3` 51 + +The 3 key. + + + +`D4` 52 + +The 4 key. + + + +`D5` 53 + +The 5 key. + + + +`D6` 54 + +The 6 key. + + + +`D7` 55 + +The 7 key. + + + +`D8` 56 + +The 8 key. + + + +`D9` 57 + +The 9 key. + + + +`Delete` 261 + +The delete key. + + + +`Down` 264 + +The down arrow key. + + + +`E` 69 + +The E key. + + + +`End` 269 + +The end key. + + + +`Enter` 257 + +The enter key. + + + +`Equal` 61 + +The equal key. + + + +`Escape` 256 + +The escape key. + + + +`F` 70 + +The F key. + + + +`F1` 290 + +The F1 key. + + + +`F10` 299 + +The F10 key. + + + +`F11` 300 + +The F11 key. + + + +`F12` 301 + +The F12 key. + + + +`F13` 302 + +The F13 key. + + + +`F14` 303 + +The F14 key. + + + +`F15` 304 + +The F15 key. + + + +`F16` 305 + +The F16 key. + + + +`F17` 306 + +The F17 key. + + + +`F18` 307 + +The F18 key. + + + +`F19` 308 + +The F19 key. + + + +`F2` 291 + +The F2 key. + + + +`F20` 309 + +The F20 key. + + + +`F21` 310 + +The F21 key. + + + +`F22` 311 + +The F22 key. + + + +`F23` 312 + +The F23 key. + + + +`F24` 313 + +The F24 key. + + + +`F25` 314 + +The F25 key. + + + +`F3` 292 + +The F3 key. + + + +`F4` 293 + +The F4 key. + + + +`F5` 294 + +The F5 key. + + + +`F6` 295 + +The F6 key. + + + +`F7` 296 + +The F7 key. + + + +`F8` 297 + +The F8 key. + + + +`F9` 298 + +The F9 key. + + + +`G` 71 + +The G key. + + + +`GraveAccent` 96 + +The grave accent key. + + + +`H` 72 + +The H key. + + + +`Home` 268 + +The home key. + + + +`I` 73 + +The I key. + + + +`Insert` 260 + +The insert key. + + + +`J` 74 + +The J key. + + + +`K` 75 + +The K key. + + + +`KeyPad0` 320 + +The 0 key on the key pad. + + + +`KeyPad1` 321 + +The 1 key on the key pad. + + + +`KeyPad2` 322 + +The 2 key on the key pad. + + + +`KeyPad3` 323 + +The 3 key on the key pad. + + + +`KeyPad4` 324 + +The 4 key on the key pad. + + + +`KeyPad5` 325 + +The 5 key on the key pad. + + + +`KeyPad6` 326 + +The 6 key on the key pad. + + + +`KeyPad7` 327 + +The 7 key on the key pad. + + + +`KeyPad8` 328 + +The 8 key on the key pad. + + + +`KeyPad9` 329 + +The 9 key on the key pad. + + + +`KeyPadAdd` 334 + +The add key on the key pad. + + + +`KeyPadDecimal` 330 + +The decimal key on the key pad. + + + +`KeyPadDivide` 331 + +The divide key on the key pad. + + + +`KeyPadEnter` 335 + +The enter key on the key pad. + + + +`KeyPadEqual` 336 + +The equal key on the key pad. + + + +`KeyPadMultiply` 332 + +The multiply key on the key pad. + + + +`KeyPadSubtract` 333 + +The subtract key on the key pad. + + + +`L` 76 + +The L key. + + + +`Left` 263 + +The left arrow key. + + + +`LeftAlt` 342 + +The left alt key. + + + +`LeftBracket` 91 + +The left bracket(opening bracket) key. + + + +`LeftControl` 341 + +The left control key. + + + +`LeftShift` 340 + +The left shift key. + + + +`LeftSuper` 343 + +The left super key. + + + +`M` 77 + +The M key. + + + +`Menu` 348 + +The menu key. + + + +`Minus` 45 + +The minus key. + + + +`N` 78 + +The N key. + + + +`NumLock` 282 + +The num lock key. + + + +`O` 79 + +The O key. + + + +`P` 80 + +The P key. + + + +`PageDown` 267 + +The page down key. + + + +`PageUp` 266 + +The page up key. + + + +`Pause` 284 + +The pause key. + + + +`Period` 46 + +The period key. + + + +`PrintScreen` 283 + +The print screen key. + + + +`Q` 81 + +The Q key. + + + +`R` 82 + +The R key. + + + +`Right` 262 + +The right arrow key. + + + +`RightAlt` 346 + +The right alt key. + + + +`RightBracket` 93 + +The right bracket(closing bracket) key. + + + +`RightControl` 345 + +The right control key. + + + +`RightShift` 344 + +The right shift key. + + + +`RightSuper` 347 + +The right super key. + + + +`S` 83 + +The S key. + + + +`ScrollLock` 281 + +The scroll lock key. + + + +`Semicolon` 59 + +The semicolon key. + + + +`Slash` 47 + +The slash key. + + + +`Space` 32 + +The space bar key. + + + +`T` 84 + +The T key. + + + +`Tab` 258 + +The tab key. + + + +`U` 85 + +The U key. + + + +`Unknown` -1 + +An unknown key. + + + +`Up` 265 + +The up arrow key. + + + +`V` 86 + +The V key. + + + +`W` 87 + +The W key. + + + +`X` 88 + +The X key. + + + +`Y` 89 + +The Y key. + + + +`Z` 90 + +The Z key. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyEventArgs.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyEventArgs.md new file mode 100644 index 00000000..658d8ef1 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyEventArgs.md @@ -0,0 +1,49 @@ +--- +title: Velaptor.Input.KeyEventArgs +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Input](Velaptor.Input.md 'Velaptor.Input') + +#### KeyEventArgs Struct + +Holds information about a keyboard key event. + +```csharp +public readonly struct KeyEventArgs : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[KeyEventArgs](Velaptor.Input.KeyEventArgs.md 'Velaptor.Input.KeyEventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Constructors + + + +### KeyEventArgs(KeyCode) Constructor + +Initializes a new instance of the [KeyEventArgs](Velaptor.Input.KeyEventArgs.md 'Velaptor.Input.KeyEventArgs') struct. + +```csharp +public KeyEventArgs(Velaptor.Input.KeyCode key); +``` +#### Parameters + + + +`key` [KeyCode](Velaptor.Input.KeyCode.md 'Velaptor.Input.KeyCode') + +The keyboard key related to the event. +## Properties + + + +### Key + +Gets the key that was pushed into the down position or lifted into the up position. + +```csharp +public Velaptor.Input.KeyCode Key { get; } +``` + +#### Property Value +[KeyCode](Velaptor.Input.KeyCode.md 'Velaptor.Input.KeyCode') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyboardState.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyboardState.md new file mode 100644 index 00000000..ca39d747 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.KeyboardState.md @@ -0,0 +1,431 @@ +--- +title: Velaptor.Input.KeyboardState +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Input](Velaptor.Input.md 'Velaptor.Input') + +#### KeyboardState Struct + +Represents a single keyboard state at a particular time. + +```csharp +public struct KeyboardState : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[KeyboardState](Velaptor.Input.KeyboardState.md 'Velaptor.Input.KeyboardState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Methods + + + +### AnyAltKeysDown() + +Returns a value indicating whether or not any of the alt keys are in the down position. + +```csharp +public bool AnyAltKeysDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if any of the control keys are down. + + + +### AnyCtrlKeysDown() + +Returns a value indicating whether or not any of the control keys are in the down position. + +```csharp +public bool AnyCtrlKeysDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if any of the control keys are down. + + + +### AnyKeysDown() + +Gets a value indicating whether or not any keys are in the down position. + +```csharp +public bool AnyKeysDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if any keys on the keyboard are in the down position. + + + +### AnyKeysDown(IEnumerable<KeyCode>) + +Returns a value indicating whether or not any of the given [keys](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.AnyKeysDown(System.Collections.Generic.IEnumerable_Velaptor.Input.KeyCode_).keys 'Velaptor.Input.KeyboardState.AnyKeysDown(System.Collections.Generic.IEnumerable).keys') are in the down position. + +```csharp +public bool AnyKeysDown(System.Collections.Generic.IEnumerable keys); +``` +#### Parameters + + + +`keys` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[KeyCode](Velaptor.Input.KeyCode.md 'Velaptor.Input.KeyCode')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') + +The list of key codes to check. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if any of the given [keys](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.AnyKeysDown(System.Collections.Generic.IEnumerable_Velaptor.Input.KeyCode_).keys 'Velaptor.Input.KeyboardState.AnyKeysDown(System.Collections.Generic.IEnumerable).keys') are in the down position. + + + +### AnyNumpadNumberKeysDown() + +Returns a value indicating whether or not any of the numpad number keys +are in the down position. + +```csharp +public bool AnyNumpadNumberKeysDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if any of the numpad number keys are in the down position. + + + +### AnyShiftKeysDown() + +Returns a value indicating whether or not any of the shift keys are in the down position. + +```csharp +public bool AnyShiftKeysDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if any of the shift keys are down. + + + +### AnyStandardNumberKeysDown() + +Returns a value indicating whether or not any of the standard number keys, +above the letter keys, are in the down position. + +```csharp +public bool AnyStandardNumberKeysDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if any of the standard number keys are in the down position. + + + +### Equals(object) + +Indicates whether this instance and a specified object are equal. + +```csharp +public override bool Equals(object? obj); +``` +#### Parameters + + + +`obj` [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') + +The object to compare with the current instance. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +[true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') if [obj](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.Equals(object).obj 'Velaptor.Input.KeyboardState.Equals(object).obj') and this instance are the same type and represent the same value; otherwise, [false](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'). + + + +### Equals(KeyboardState) + +```csharp +public bool Equals(Velaptor.Input.KeyboardState other); +``` +#### Parameters + + + +`other` [KeyboardState](Velaptor.Input.KeyboardState.md 'Velaptor.Input.KeyboardState') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### GetDownKeys() + +Returns all of the keys that are in the down position. + +```csharp +public Velaptor.Input.KeyCode[] GetDownKeys(); +``` + +#### Returns +[KeyCode](Velaptor.Input.KeyCode.md 'Velaptor.Input.KeyCode')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') +A list of the keys that are currently in the down position. + + + +### GetHashCode() + +Returns the hash code for this instance. + +```csharp +public override int GetHashCode(); +``` + +#### Returns +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +A 32-bit signed integer that is the hash code for this instance. + + + +### GetKeyStates() + +Returns all of the keys and their states. + +```csharp +public System.Collections.Generic.Dictionary GetKeyStates(); +``` + +#### Returns +[System.Collections.Generic.Dictionary<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.Dictionary-2 'System.Collections.Generic.Dictionary`2')[KeyCode](Velaptor.Input.KeyCode.md 'Velaptor.Input.KeyCode')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.Dictionary-2 'System.Collections.Generic.Dictionary`2')[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.Dictionary-2 'System.Collections.Generic.Dictionary`2') +The keys and given state for each key. + + + +### IsKeyDown(KeyCode) + +Returns a value indicating whether or not the given [key](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.IsKeyDown(Velaptor.Input.KeyCode).key 'Velaptor.Input.KeyboardState.IsKeyDown(Velaptor.Input.KeyCode).key') is in the down position. + +```csharp +public bool IsKeyDown(Velaptor.Input.KeyCode key); +``` +#### Parameters + + + +`key` [KeyCode](Velaptor.Input.KeyCode.md 'Velaptor.Input.KeyCode') + +The key to check. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the given [key](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.IsKeyDown(Velaptor.Input.KeyCode).key 'Velaptor.Input.KeyboardState.IsKeyDown(Velaptor.Input.KeyCode).key') is in the down position. + + + +### IsKeyUp(KeyCode) + +Returns a value indicating whether or not the given [key](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.IsKeyUp(Velaptor.Input.KeyCode).key 'Velaptor.Input.KeyboardState.IsKeyUp(Velaptor.Input.KeyCode).key') is in the up position. + +```csharp +public bool IsKeyUp(Velaptor.Input.KeyCode key); +``` +#### Parameters + + + +`key` [KeyCode](Velaptor.Input.KeyCode.md 'Velaptor.Input.KeyCode') + +The key to check. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the given [key](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.IsKeyUp(Velaptor.Input.KeyCode).key 'Velaptor.Input.KeyboardState.IsKeyUp(Velaptor.Input.KeyCode).key') is in the up position. + + + +### IsLeftAltKeyDown() + +Gets a value indicating whether or not the left alt key is in the down position. + +```csharp +public bool IsLeftAltKeyDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the left alt key is down. + + + +### IsLeftCtrlKeyDown() + +Gets a value indicating whether or not the left control key is in the down position. + +```csharp +public bool IsLeftCtrlKeyDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the left control key is down. + + + +### IsLeftShiftKeyDown() + +Gets a value indicating whether or not the left shift key is in the down position. + +```csharp +public bool IsLeftShiftKeyDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the left shift key is down. + + + +### IsRightAltKeyDown() + +Gets a value indicating whether or not the right alt key is in the down position. + +```csharp +public bool IsRightAltKeyDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the right alt key is down. + + + +### IsRightCtrlKeyDown() + +Gets a value indicating whether or not the right control key is in the down position. + +```csharp +public bool IsRightCtrlKeyDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the right control key is down. + + + +### IsRightShiftKeyDown() + +Gets a value indicating whether or not the right shift key is in the down position. + +```csharp +public bool IsRightShiftKeyDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the right shift key is down. + + + +### KeyToChar(KeyCode) + +Returns the character equivalent of the given key if it is +a letter, number or symbol key. The value of 0 will be returned +if the key is not a letter, number or symbol. + +```csharp +public char KeyToChar(Velaptor.Input.KeyCode key); +``` +#### Parameters + + + +`key` [KeyCode](Velaptor.Input.KeyCode.md 'Velaptor.Input.KeyCode') + +The key to check. + +#### Returns +[System.Char](https://docs.microsoft.com/en-us/dotnet/api/System.Char 'System.Char') +The character that matches the given key. + + + +### SetKeyState(KeyCode, bool) + +Sets the state of the given [key](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.SetKeyState(Velaptor.Input.KeyCode,bool).key 'Velaptor.Input.KeyboardState.SetKeyState(Velaptor.Input.KeyCode, bool).key') to the given [state](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.SetKeyState(Velaptor.Input.KeyCode,bool).state 'Velaptor.Input.KeyboardState.SetKeyState(Velaptor.Input.KeyCode, bool).state') value. + +```csharp +public void SetKeyState(Velaptor.Input.KeyCode key, bool state); +``` +#### Parameters + + + +`key` [KeyCode](Velaptor.Input.KeyCode.md 'Velaptor.Input.KeyCode') + +The key to set the state to. + + + +`state` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +The state of the key. +### Operators + + + +## KeyboardState.operator ==(KeyboardState, KeyboardState) Operator + +Returns a value indicating whether or not the [left](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.op_Equality(Velaptor.Input.KeyboardState,Velaptor.Input.KeyboardState).left 'Velaptor.Input.KeyboardState.op_Equality(Velaptor.Input.KeyboardState, Velaptor.Input.KeyboardState).left') operand is equal to the [right](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.op_Equality(Velaptor.Input.KeyboardState,Velaptor.Input.KeyboardState).right 'Velaptor.Input.KeyboardState.op_Equality(Velaptor.Input.KeyboardState, Velaptor.Input.KeyboardState).right') operand. + +```csharp +public static bool operator ==(Velaptor.Input.KeyboardState left, Velaptor.Input.KeyboardState right); +``` +#### Parameters + + + +`left` [KeyboardState](Velaptor.Input.KeyboardState.md 'Velaptor.Input.KeyboardState') + +The left operand. + + + +`right` [KeyboardState](Velaptor.Input.KeyboardState.md 'Velaptor.Input.KeyboardState') + +The right operand. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if operands are equal. + + + +## KeyboardState.operator !=(KeyboardState, KeyboardState) Operator + +Returns a value indicating whether or not the [left](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.op_Inequality(Velaptor.Input.KeyboardState,Velaptor.Input.KeyboardState).left 'Velaptor.Input.KeyboardState.op_Inequality(Velaptor.Input.KeyboardState, Velaptor.Input.KeyboardState).left') operand is not equal to the [right](Velaptor.Input.KeyboardState.md#Velaptor.Input.KeyboardState.op_Inequality(Velaptor.Input.KeyboardState,Velaptor.Input.KeyboardState).right 'Velaptor.Input.KeyboardState.op_Inequality(Velaptor.Input.KeyboardState, Velaptor.Input.KeyboardState).right') operand. + +```csharp +public static bool operator !=(Velaptor.Input.KeyboardState left, Velaptor.Input.KeyboardState right); +``` +#### Parameters + + + +`left` [KeyboardState](Velaptor.Input.KeyboardState.md 'Velaptor.Input.KeyboardState') + +The left operand. + + + +`right` [KeyboardState](Velaptor.Input.KeyboardState.md 'Velaptor.Input.KeyboardState') + +The right operand. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if operands are not equal. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseButton.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseButton.md new file mode 100644 index 00000000..13116c22 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseButton.md @@ -0,0 +1,33 @@ +--- +title: Velaptor.Input.MouseButton +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Input](Velaptor.Input.md 'Velaptor.Input') + +## MouseButton Enum + +Represents the buttons on a mouse. + +```csharp +public enum MouseButton +``` +#### Fields + + + +`LeftButton` 0 + +Represents the left mouse button. + + + +`MiddleButton` 2 + +Represents the middle mouse button. + + + +`RightButton` 1 + +Represents the right mouse button. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseScrollDirection.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseScrollDirection.md new file mode 100644 index 00000000..c87ac26a --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseScrollDirection.md @@ -0,0 +1,33 @@ +--- +title: Velaptor.Input.MouseScrollDirection +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Input](Velaptor.Input.md 'Velaptor.Input') + +## MouseScrollDirection Enum + +Represents the different scroll directions of a mouse. + +```csharp +public enum MouseScrollDirection +``` +#### Fields + + + +`None` 0 + +The mouse wheel has not been scrolled in any direction. + + + +`ScrollDown` 1 + +The mouse wheel scrolling in the down direction. + + + +`ScrollUp` 2 + +The mouse wheel scrolling in the up direction. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseState.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseState.md new file mode 100644 index 00000000..d64c4e9d --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.MouseState.md @@ -0,0 +1,363 @@ +--- +title: Velaptor.Input.MouseState +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Input](Velaptor.Input.md 'Velaptor.Input') + +#### MouseState Struct + +Represents the state of the mouse. + +```csharp +public struct MouseState : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[MouseState](Velaptor.Input.MouseState.md 'Velaptor.Input.MouseState')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Methods + + + +### AnyButtonsDown() + +Returns a value indicating whether or not any of the mouse buttons are in the down position. + +```csharp +public bool AnyButtonsDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +True if any buttons are in the down position. + + + +### Equals(object) + +Indicates whether this instance and a specified object are equal. + +```csharp +public override bool Equals(object? obj); +``` +#### Parameters + + + +`obj` [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') + +The object to compare with the current instance. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +[true](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool') if [obj](Velaptor.Input.MouseState.md#Velaptor.Input.MouseState.Equals(object).obj 'Velaptor.Input.MouseState.Equals(object).obj') and this instance are the same type and represent the same value; otherwise, [false](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool'). + + + +### Equals(MouseState) + +```csharp +public bool Equals(Velaptor.Input.MouseState other); +``` +#### Parameters + + + +`other` [MouseState](Velaptor.Input.MouseState.md 'Velaptor.Input.MouseState') + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### GetButtonState(MouseButton) + +Returns a value indicating whether or not the state for the given [mouseButton](Velaptor.Input.MouseState.md#Velaptor.Input.MouseState.GetButtonState(Velaptor.Input.MouseButton).mouseButton 'Velaptor.Input.MouseState.GetButtonState(Velaptor.Input.MouseButton).mouseButton') +is in the down or up position. + +```csharp +public bool GetButtonState(Velaptor.Input.MouseButton mouseButton); +``` +#### Parameters + + + +`mouseButton` [MouseButton](Velaptor.Input.MouseButton.md 'Velaptor.Input.MouseButton') + +The button state to retrieve. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the button is down. + + + +### GetHashCode() + +Returns the hash code for this instance. + +```csharp +public override int GetHashCode(); +``` + +#### Returns +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +A 32-bit signed integer that is the hash code for this instance. + + + +### GetPosition() + +Gets or sets the position of the mouse. + +```csharp +public System.Drawing.Point GetPosition(); +``` + +#### Returns +[System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') +The position relative to the top left corner of the window. + + + +### GetScrollDirection() + +Gets the direction that the mouse wheel has been turned. + +```csharp +public Velaptor.Input.MouseScrollDirection GetScrollDirection(); +``` + +#### Returns +[MouseScrollDirection](Velaptor.Input.MouseScrollDirection.md 'Velaptor.Input.MouseScrollDirection') +The scroll direction of the mouse wheel. + + + +### GetScrollWheelValue() + +Gets the position value of the mouse scroll wheel. + +```csharp +public int GetScrollWheelValue(); +``` + +#### Returns +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +The value of the scroll wheel. + + + +### GetX() + +Gets or sets the X position of the mouse. + +```csharp +public int GetX(); +``` + +#### Returns +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +The X position relative to the top left corner of the window. + + + +### GetY() + +Gets or sets the Y position of the mouse. + +```csharp +public int GetY(); +``` + +#### Returns +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +The Y position relative to the top left corner of the window. + + + +### IsButtonDown(MouseButton) + +Returns a value indicating whether or not the given mouse [button](Velaptor.Input.MouseState.md#Velaptor.Input.MouseState.IsButtonDown(Velaptor.Input.MouseButton).button 'Velaptor.Input.MouseState.IsButtonDown(Velaptor.Input.MouseButton).button') +is in the down position. + +```csharp +public bool IsButtonDown(Velaptor.Input.MouseButton button); +``` +#### Parameters + + + +`button` [MouseButton](Velaptor.Input.MouseButton.md 'Velaptor.Input.MouseButton') + +The mouse button to check. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +True if the mouse button is in the down position. + + + +### IsButtonUp(MouseButton) + +Returns a value indicating whether or not the given mouse [button](Velaptor.Input.MouseState.md#Velaptor.Input.MouseState.IsButtonUp(Velaptor.Input.MouseButton).button 'Velaptor.Input.MouseState.IsButtonUp(Velaptor.Input.MouseButton).button') +is in the up position. + +```csharp +public bool IsButtonUp(Velaptor.Input.MouseButton button); +``` +#### Parameters + + + +`button` [MouseButton](Velaptor.Input.MouseButton.md 'Velaptor.Input.MouseButton') + +The mouse button to check. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +True if the mouse button is in the up position. + +#### Exceptions + +[System.ComponentModel.InvalidEnumArgumentException](https://docs.microsoft.com/en-us/dotnet/api/System.ComponentModel.InvalidEnumArgumentException 'System.ComponentModel.InvalidEnumArgumentException') +Occurs if the [MouseButton](Velaptor.Input.MouseButton.md 'Velaptor.Input.MouseButton') is an invalid value. + + + +### IsLeftButtonDown() + +Gets or sets a value indicating whether or not the left mouse button is in the down position. + +```csharp +public bool IsLeftButtonDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the button is down. + + + +### IsLeftButtonUp() + +Returns a value indicating whether or not the left mouse button is in the up position. + +```csharp +public bool IsLeftButtonUp(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the button is up. + + + +### IsMiddleButtonDown() + +Gets or sets a value indicating whether or not the middle mouse button is in the down position. + +```csharp +public bool IsMiddleButtonDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the button is down. + + + +### IsMiddleButtonUp() + +Returns a value indicating whether or not the middle mouse button is in the up position. + +```csharp +public bool IsMiddleButtonUp(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the button is up. + + + +### IsRightButtonDown() + +Gets or sets a value indicating whether or not the right mouse button is in the down position. + +```csharp +public bool IsRightButtonDown(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the button is down. + + + +### IsRightButtonUp() + +Returns a value indicating whether or not the right mouse button is in the up position. + +```csharp +public bool IsRightButtonUp(); +``` + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the button is up. +### Operators + + + +## MouseState.operator ==(MouseState, MouseState) Operator + +Returns a value indicating whether or not the [left](Velaptor.Input.MouseState.md#Velaptor.Input.MouseState.op_Equality(Velaptor.Input.MouseState,Velaptor.Input.MouseState).left 'Velaptor.Input.MouseState.op_Equality(Velaptor.Input.MouseState, Velaptor.Input.MouseState).left') operand is equal to the [right](Velaptor.Input.MouseState.md#Velaptor.Input.MouseState.op_Equality(Velaptor.Input.MouseState,Velaptor.Input.MouseState).right 'Velaptor.Input.MouseState.op_Equality(Velaptor.Input.MouseState, Velaptor.Input.MouseState).right') operand. + +```csharp +public static bool operator ==(Velaptor.Input.MouseState left, Velaptor.Input.MouseState right); +``` +#### Parameters + + + +`left` [MouseState](Velaptor.Input.MouseState.md 'Velaptor.Input.MouseState') + +The left side of the operator. + + + +`right` [MouseState](Velaptor.Input.MouseState.md 'Velaptor.Input.MouseState') + +The right side of the operator. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the operands are equal. + + + +## MouseState.operator !=(MouseState, MouseState) Operator + +Returns a value indicating whether or not the [left](Velaptor.Input.MouseState.md#Velaptor.Input.MouseState.op_Inequality(Velaptor.Input.MouseState,Velaptor.Input.MouseState).left 'Velaptor.Input.MouseState.op_Inequality(Velaptor.Input.MouseState, Velaptor.Input.MouseState).left') operand is not equal to the [right](Velaptor.Input.MouseState.md#Velaptor.Input.MouseState.op_Inequality(Velaptor.Input.MouseState,Velaptor.Input.MouseState).right 'Velaptor.Input.MouseState.op_Inequality(Velaptor.Input.MouseState, Velaptor.Input.MouseState).right') operand. + +```csharp +public static bool operator !=(Velaptor.Input.MouseState left, Velaptor.Input.MouseState right); +``` +#### Parameters + + + +`left` [MouseState](Velaptor.Input.MouseState.md 'Velaptor.Input.MouseState') + +The left side of the operator. + + + +`right` [MouseState](Velaptor.Input.MouseState.md 'Velaptor.Input.MouseState') + +The right side of the operator. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if the operands are not equal. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.md new file mode 100644 index 00000000..9ab8cf85 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Input.md @@ -0,0 +1,23 @@ +--- +title: Velaptor.Input +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Input Namespace + +| Structs | | +| :--- | :--- | +| [KeyboardState](Velaptor.Input.KeyboardState.md 'Velaptor.Input.KeyboardState') | Represents a single keyboard state at a particular time. | +| [KeyEventArgs](Velaptor.Input.KeyEventArgs.md 'Velaptor.Input.KeyEventArgs') | Holds information about a keyboard key event. | +| [MouseState](Velaptor.Input.MouseState.md 'Velaptor.Input.MouseState') | Represents the state of the mouse. | + +| Interfaces | | +| :--- | :--- | +| [IAppInput<TState>](Velaptor.Input.IAppInput_TState_.md 'Velaptor.Input.IAppInput') | Gets the state of game-specific input such as a mouse or keyboard. | + +| Enums | | +| :--- | :--- | +| [KeyCode](Velaptor.Input.KeyCode.md 'Velaptor.Input.KeyCode') | Specifies key codes and modifiers in US keyboard layout. | +| [MouseButton](Velaptor.Input.MouseButton.md 'Velaptor.Input.MouseButton') | Represents the buttons on a mouse. | +| [MouseScrollDirection](Velaptor.Input.MouseScrollDirection.md 'Velaptor.Input.MouseScrollDirection') | Represents the different scroll directions of a mouse. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.BufferNotInitializedException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.BufferNotInitializedException.md new file mode 100644 index 00000000..f40d3d54 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.BufferNotInitializedException.md @@ -0,0 +1,73 @@ +--- +title: Velaptor.OpenGL.Exceptions.BufferNotInitializedException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.OpenGL.Exceptions](Velaptor.OpenGL.Exceptions.md 'Velaptor.OpenGL.Exceptions') + +#### BufferNotInitializedException Class + +Thrown when a buffer has not been initialized. + +```csharp +public sealed class BufferNotInitializedException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ BufferNotInitializedException +## Constructors + + + +### BufferNotInitializedException() Constructor + +Initializes a new instance of the [BufferNotInitializedException](Velaptor.OpenGL.Exceptions.BufferNotInitializedException.md 'Velaptor.OpenGL.Exceptions.BufferNotInitializedException') class. + +```csharp +public BufferNotInitializedException(); +``` + + + +### BufferNotInitializedException(string, string) Constructor + +Initializes a new instance of the [BufferNotInitializedException](Velaptor.OpenGL.Exceptions.BufferNotInitializedException.md 'Velaptor.OpenGL.Exceptions.BufferNotInitializedException') class. + +```csharp +public BufferNotInitializedException(string message, string bufferName=""); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`bufferName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the buffer. + + + +### BufferNotInitializedException(string, Exception) Constructor + +Initializes a new instance of the [BufferNotInitializedException](Velaptor.OpenGL.Exceptions.BufferNotInitializedException.md 'Velaptor.OpenGL.Exceptions.BufferNotInitializedException') class. + +```csharp +public BufferNotInitializedException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderCompileException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderCompileException.md new file mode 100644 index 00000000..b39cd8e0 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderCompileException.md @@ -0,0 +1,73 @@ +--- +title: Velaptor.OpenGL.Exceptions.ShaderCompileException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.OpenGL.Exceptions](Velaptor.OpenGL.Exceptions.md 'Velaptor.OpenGL.Exceptions') + +#### ShaderCompileException Class + +Thrown when there is an issue compiling a shader. + +```csharp +public sealed class ShaderCompileException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ ShaderCompileException +## Constructors + + + +### ShaderCompileException() Constructor + +Initializes a new instance of the [ShaderCompileException](Velaptor.OpenGL.Exceptions.ShaderCompileException.md 'Velaptor.OpenGL.Exceptions.ShaderCompileException') class. + +```csharp +public ShaderCompileException(); +``` + + + +### ShaderCompileException(string, string) Constructor + +Initializes a new instance of the [ShaderCompileException](Velaptor.OpenGL.Exceptions.ShaderCompileException.md 'Velaptor.OpenGL.Exceptions.ShaderCompileException') class. + +```csharp +public ShaderCompileException(string message, string bufferName=""); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`bufferName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the buffer. + + + +### ShaderCompileException(string, Exception) Constructor + +Initializes a new instance of the [ShaderCompileException](Velaptor.OpenGL.Exceptions.ShaderCompileException.md 'Velaptor.OpenGL.Exceptions.ShaderCompileException') class. + +```csharp +public ShaderCompileException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderLinkException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderLinkException.md new file mode 100644 index 00000000..9b9768c7 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderLinkException.md @@ -0,0 +1,73 @@ +--- +title: Velaptor.OpenGL.Exceptions.ShaderLinkException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.OpenGL.Exceptions](Velaptor.OpenGL.Exceptions.md 'Velaptor.OpenGL.Exceptions') + +#### ShaderLinkException Class + +Thrown when there is an issue linking a shader. + +```csharp +public sealed class ShaderLinkException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ ShaderLinkException +## Constructors + + + +### ShaderLinkException() Constructor + +Initializes a new instance of the [ShaderLinkException](Velaptor.OpenGL.Exceptions.ShaderLinkException.md 'Velaptor.OpenGL.Exceptions.ShaderLinkException') class. + +```csharp +public ShaderLinkException(); +``` + + + +### ShaderLinkException(string, string) Constructor + +Initializes a new instance of the [ShaderLinkException](Velaptor.OpenGL.Exceptions.ShaderLinkException.md 'Velaptor.OpenGL.Exceptions.ShaderLinkException') class. + +```csharp +public ShaderLinkException(string message, string bufferName=""); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`bufferName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the buffer. + + + +### ShaderLinkException(string, Exception) Constructor + +Initializes a new instance of the [ShaderLinkException](Velaptor.OpenGL.Exceptions.ShaderLinkException.md 'Velaptor.OpenGL.Exceptions.ShaderLinkException') class. + +```csharp +public ShaderLinkException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderNotInitializedException.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderNotInitializedException.md new file mode 100644 index 00000000..c74ef891 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.ShaderNotInitializedException.md @@ -0,0 +1,73 @@ +--- +title: Velaptor.OpenGL.Exceptions.ShaderNotInitializedException +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.OpenGL.Exceptions](Velaptor.OpenGL.Exceptions.md 'Velaptor.OpenGL.Exceptions') + +#### ShaderNotInitializedException Class + +Thrown when a shader has not been initialized. + +```csharp +public sealed class ShaderNotInitializedException : System.Exception +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') โ†’ ShaderNotInitializedException +## Constructors + + + +### ShaderNotInitializedException() Constructor + +Initializes a new instance of the [ShaderNotInitializedException](Velaptor.OpenGL.Exceptions.ShaderNotInitializedException.md 'Velaptor.OpenGL.Exceptions.ShaderNotInitializedException') class. + +```csharp +public ShaderNotInitializedException(); +``` + + + +### ShaderNotInitializedException(string, string) Constructor + +Initializes a new instance of the [ShaderNotInitializedException](Velaptor.OpenGL.Exceptions.ShaderNotInitializedException.md 'Velaptor.OpenGL.Exceptions.ShaderNotInitializedException') class. + +```csharp +public ShaderNotInitializedException(string message, string shaderName=""); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`shaderName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The name of the shader. + + + +### ShaderNotInitializedException(string, Exception) Constructor + +Initializes a new instance of the [ShaderNotInitializedException](Velaptor.OpenGL.Exceptions.ShaderNotInitializedException.md 'Velaptor.OpenGL.Exceptions.ShaderNotInitializedException') class. + +```csharp +public ShaderNotInitializedException(string message, System.Exception innerException); +``` +#### Parameters + + + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The message that describes the error. + + + +`innerException` [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') + +The [System.Exception](https://docs.microsoft.com/en-us/dotnet/api/System.Exception 'System.Exception') instance that caused the current exception. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.md new file mode 100644 index 00000000..d848700b --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.OpenGL.Exceptions.md @@ -0,0 +1,14 @@ +--- +title: Velaptor.OpenGL.Exceptions +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.OpenGL.Exceptions Namespace + +| Classes | | +| :--- | :--- | +| [BufferNotInitializedException](Velaptor.OpenGL.Exceptions.BufferNotInitializedException.md 'Velaptor.OpenGL.Exceptions.BufferNotInitializedException') | Thrown when a buffer has not been initialized. | +| [ShaderCompileException](Velaptor.OpenGL.Exceptions.ShaderCompileException.md 'Velaptor.OpenGL.Exceptions.ShaderCompileException') | Thrown when there is an issue compiling a shader. | +| [ShaderLinkException](Velaptor.OpenGL.Exceptions.ShaderLinkException.md 'Velaptor.OpenGL.Exceptions.ShaderLinkException') | Thrown when there is an issue linking a shader. | +| [ShaderNotInitializedException](Velaptor.OpenGL.Exceptions.ShaderNotInitializedException.md 'Velaptor.OpenGL.Exceptions.ShaderNotInitializedException') | Thrown when a shader has not been initialized. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Platform.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Platform.md new file mode 100644 index 00000000..97a1c7d2 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Platform.md @@ -0,0 +1,65 @@ +--- +title: Velaptor.Platform +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +#### Platform Class + +Represents the current platform. + +```csharp +public sealed class Platform : +Velaptor.IPlatform +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ Platform + +Implements [IPlatform](Velaptor.IPlatform.md 'Velaptor.IPlatform') +## Properties + + + +### CurrentPlatform + +Gets the current platform of the system. + +```csharp +public System.Runtime.InteropServices.OSPlatform CurrentPlatform { get; } +``` + +Implements [CurrentPlatform](Velaptor.IPlatform.md#Velaptor.IPlatform.CurrentPlatform 'Velaptor.IPlatform.CurrentPlatform') + +#### Property Value +[System.Runtime.InteropServices.OSPlatform](https://docs.microsoft.com/en-us/dotnet/api/System.Runtime.InteropServices.OSPlatform 'System.Runtime.InteropServices.OSPlatform') + + + +### Is32BitProcess + +Gets a value indicating whether or not the system is a 32 bit process. + +```csharp +public bool Is32BitProcess { get; } +``` + +Implements [Is32BitProcess](Velaptor.IPlatform.md#Velaptor.IPlatform.Is32BitProcess 'Velaptor.IPlatform.Is32BitProcess') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Is64BitProcess + +Gets a value indicating whether or not the system is a 64 bit process. + +```csharp +public bool Is64BitProcess { get; } +``` + +Implements [Is64BitProcess](Velaptor.IPlatform.md#Velaptor.IPlatform.Is64BitProcess 'Velaptor.IPlatform.Is64BitProcess') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.IScene.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.IScene.md new file mode 100644 index 00000000..08f00a56 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.IScene.md @@ -0,0 +1,143 @@ +--- +title: Velaptor.Scene.IScene +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Scene](Velaptor.Scene.md 'Velaptor.Scene') + +#### IScene Interface + +Represents a single scene that can be rendered to the screen. + +```csharp +public interface IScene : +Velaptor.IUpdatable, +Velaptor.IDrawable, +System.IDisposable +``` + +Derived +↳ [SceneBase](Velaptor.Scene.SceneBase.md 'Velaptor.Scene.SceneBase') + +Implements [IUpdatable](Velaptor.IUpdatable.md 'Velaptor.IUpdatable'), [IDrawable](Velaptor.IDrawable.md 'Velaptor.IDrawable'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable') +## Properties + + + +### Id + +Gets the unique ID of the scene. + +```csharp +System.Guid Id { get; } +``` + +#### Property Value +[System.Guid](https://docs.microsoft.com/en-us/dotnet/api/System.Guid 'System.Guid') + + + +### IsLoaded + +Gets a value indicating whether or not the scene has been loaded. + +```csharp +bool IsLoaded { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Name + +Gets the name of the scene. + +```csharp +string Name { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### WindowCenter + +Gets the center of the window. + +```csharp +System.Drawing.Point WindowCenter { get; } +``` + +#### Property Value +[System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + + + +### WindowSize + +Gets the size of the window. + +```csharp +Velaptor.SizeU WindowSize { get; } +``` + +#### Property Value +[SizeU](Velaptor.SizeU.md 'Velaptor.SizeU') +## Methods + + + +### AddControl(IControl) + +Adds a control to the scene to be updated and rendered. + +```csharp +void AddControl(Velaptor.UI.IControl control); +``` +#### Parameters + + + +`control` [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') + +The control to add to the scene. + + + +### LoadContent() + +Loads the scene content. + +```csharp +void LoadContent(); +``` + + + +### RemoveControl(IControl) + +Removes the given [control](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.RemoveControl(Velaptor.UI.IControl).control 'Velaptor.Scene.IScene.RemoveControl(Velaptor.UI.IControl).control') from the scene. + +```csharp +void RemoveControl(Velaptor.UI.IControl control); +``` +#### Parameters + + + +`control` [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') + +The control to remove. + + + +### UnloadContent() + +Unloads the scene's content. + +```csharp +void UnloadContent(); +``` \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.ISceneManager.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.ISceneManager.md new file mode 100644 index 00000000..55e78fa2 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.ISceneManager.md @@ -0,0 +1,218 @@ +--- +title: Velaptor.Scene.ISceneManager +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Scene](Velaptor.Scene.md 'Velaptor.Scene') + +#### ISceneManager Interface + +Manages scenes by loading and unloading content, updating, and rendering scenes. + +```csharp +public interface ISceneManager : +Velaptor.IUpdatable, +Velaptor.IDrawable, +System.IDisposable +``` + +Implements [IUpdatable](Velaptor.IUpdatable.md 'Velaptor.IUpdatable'), [IDrawable](Velaptor.IDrawable.md 'Velaptor.IDrawable'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable') +## Properties + + + +### CurrentScene + +Gets the current scene. + +```csharp +Velaptor.Scene.IScene? CurrentScene { get; } +``` + +#### Property Value +[IScene](Velaptor.Scene.IScene.md 'Velaptor.Scene.IScene') + + + +### InActiveScenes + +Gets a list of all the [System.Guid](https://docs.microsoft.com/en-us/dotnet/api/System.Guid 'System.Guid')'s for the scenes that are inactive. + +```csharp +System.Collections.Generic.IReadOnlyCollection InActiveScenes { get; } +``` + +#### Property Value +[System.Collections.Generic.IReadOnlyCollection<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1')[System.Guid](https://docs.microsoft.com/en-us/dotnet/api/System.Guid 'System.Guid')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1') + + + +### IsLoaded + +Gets a value indicating whether or not the scene manager has been loaded. + +```csharp +bool IsLoaded { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Remarks +This does not mean that the content in the individual scenes have been loaded. + + + +### TotalScenes + +Gets the total number of scenes. + +```csharp +int TotalScenes { get; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +## Methods + + + +### AddScene(IScene, bool) + +Adds the given scene and sets it as active or inactive. + +```csharp +void AddScene(Velaptor.Scene.IScene scene, bool setToActive); +``` +#### Parameters + + + +`scene` [IScene](Velaptor.Scene.IScene.md 'Velaptor.Scene.IScene') + +The scene to add. + + + +`setToActive` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +When set to `true`, the scene being added will be set to active and +all other scenes will bet set to inactive. + + + +### AddScene(IScene) + +Adds the given scene. + +```csharp +void AddScene(Velaptor.Scene.IScene scene); +``` +#### Parameters + + + +`scene` [IScene](Velaptor.Scene.IScene.md 'Velaptor.Scene.IScene') + +The scene to add. + +#### Remarks +The scene will not be activated when added using this method. + + + +### LoadContent() + +Loads the content for the manager and the current scene. + +```csharp +void LoadContent(); +``` + + + +### NextScene() + +Moves to the next scene. + +```csharp +void NextScene(); +``` + + + +### PreviousScene() + +Moves to the previous scene. + +```csharp +void PreviousScene(); +``` + + + +### RemoveScene(Guid) + +Removes the scene that matches the given [sceneId](Velaptor.Scene.ISceneManager.md#Velaptor.Scene.ISceneManager.RemoveScene(System.Guid).sceneId 'Velaptor.Scene.ISceneManager.RemoveScene(System.Guid).sceneId'). + +```csharp +void RemoveScene(System.Guid sceneId); +``` +#### Parameters + + + +`sceneId` [System.Guid](https://docs.microsoft.com/en-us/dotnet/api/System.Guid 'System.Guid') + +The ID of the scene to remove. + + + +### SceneExists(Guid) + +Returns a value indicating whether or not a scene exists that matches the given [id](Velaptor.Scene.ISceneManager.md#Velaptor.Scene.ISceneManager.SceneExists(System.Guid).id 'Velaptor.Scene.ISceneManager.SceneExists(System.Guid).id'). + +```csharp +bool SceneExists(System.Guid id); +``` +#### Parameters + + + +`id` [System.Guid](https://docs.microsoft.com/en-us/dotnet/api/System.Guid 'System.Guid') + +The ID of the scene. + +#### Returns +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +`true` if a scene exists with the given ID. + + + +### SetSceneAsActive(Guid) + +Sets a scene that matches the given [id](Velaptor.Scene.ISceneManager.md#Velaptor.Scene.ISceneManager.SetSceneAsActive(System.Guid).id 'Velaptor.Scene.ISceneManager.SetSceneAsActive(System.Guid).id') to be the active scene. + +```csharp +void SetSceneAsActive(System.Guid id); +``` +#### Parameters + + + +`id` [System.Guid](https://docs.microsoft.com/en-us/dotnet/api/System.Guid 'System.Guid') + +The ID of the scene. + +#### Remarks +This will set all of the other scenes to inactive. + + + +### UnloadContent() + +Unloads the scene manager content and added scenes. + +```csharp +void UnloadContent(); +``` \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.SceneBase.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.SceneBase.md new file mode 100644 index 00000000..63943ced --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.SceneBase.md @@ -0,0 +1,217 @@ +--- +title: Velaptor.Scene.SceneBase +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.Scene](Velaptor.Scene.md 'Velaptor.Scene') + +#### SceneBase Class + +A base scene to be used for creating new custom scenes. + +```csharp +public abstract class SceneBase : +Velaptor.Scene.IScene, +Velaptor.IUpdatable, +Velaptor.IDrawable, +System.IDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ SceneBase + +Implements [IScene](Velaptor.Scene.IScene.md 'Velaptor.Scene.IScene'), [IUpdatable](Velaptor.IUpdatable.md 'Velaptor.IUpdatable'), [IDrawable](Velaptor.IDrawable.md 'Velaptor.IDrawable'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable') +## Properties + + + +### Controls + +Gets the list of controls that have been added to the scene. + +```csharp +public System.Collections.Generic.IReadOnlyList Controls { get; } +``` + +#### Property Value +[System.Collections.Generic.IReadOnlyList<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyList-1 'System.Collections.Generic.IReadOnlyList`1')[IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyList-1 'System.Collections.Generic.IReadOnlyList`1') + + + +### Id + +Gets the unique ID of the scene. + +```csharp +public System.Guid Id { get; } +``` + +Implements [Id](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.Id 'Velaptor.Scene.IScene.Id') + +#### Property Value +[System.Guid](https://docs.microsoft.com/en-us/dotnet/api/System.Guid 'System.Guid') + + + +### IsLoaded + +Gets the name of the scene. + +```csharp +public bool IsLoaded { get; set; } +``` + +Implements [IsLoaded](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.IsLoaded 'Velaptor.Scene.IScene.IsLoaded') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Name + +Gets the name of the scene. + +```csharp +public string Name { get; set; } +``` + +Implements [Name](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.Name 'Velaptor.Scene.IScene.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### WindowCenter + +Gets the center of the window. + +```csharp +public System.Drawing.Point WindowCenter { get; } +``` + +Implements [WindowCenter](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.WindowCenter 'Velaptor.Scene.IScene.WindowCenter') + +#### Property Value +[System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + + + +### WindowSize + +Gets the size of the window. + +```csharp +public Velaptor.SizeU WindowSize { get; set; } +``` + +Implements [WindowSize](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.WindowSize 'Velaptor.Scene.IScene.WindowSize') + +#### Property Value +[SizeU](Velaptor.SizeU.md 'Velaptor.SizeU') +## Methods + + + +### AddControl(IControl) + +Adds a control to the scene to be updated and rendered. + +```csharp +public void AddControl(Velaptor.UI.IControl control); +``` +#### Parameters + + + +`control` [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') + +The control to add to the scene. + +Implements [AddControl(IControl)](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.AddControl(Velaptor.UI.IControl) 'Velaptor.Scene.IScene.AddControl(Velaptor.UI.IControl)') + + + +### Dispose() + +Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') + + + +### LoadContent() + +Loads the scene content. + +```csharp +public virtual void LoadContent(); +``` + +Implements [LoadContent()](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.LoadContent() 'Velaptor.Scene.IScene.LoadContent()') + + + +### RemoveControl(IControl) + +Removes the given [control](Velaptor.Scene.SceneBase.md#Velaptor.Scene.SceneBase.RemoveControl(Velaptor.UI.IControl).control 'Velaptor.Scene.SceneBase.RemoveControl(Velaptor.UI.IControl).control') from the scene. + +```csharp +public void RemoveControl(Velaptor.UI.IControl control); +``` +#### Parameters + + + +`control` [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') + +The control to remove. + +Implements [RemoveControl(IControl)](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.RemoveControl(Velaptor.UI.IControl) 'Velaptor.Scene.IScene.RemoveControl(Velaptor.UI.IControl)') + + + +### Render() + +Renders the object. + +```csharp +public virtual void Render(); +``` + +Implements [Render()](Velaptor.IDrawable.md#Velaptor.IDrawable.Render() 'Velaptor.IDrawable.Render()') + + + +### UnloadContent() + +Unloads the scene's content. + +```csharp +public virtual void UnloadContent(); +``` + +Implements [UnloadContent()](Velaptor.Scene.IScene.md#Velaptor.Scene.IScene.UnloadContent() 'Velaptor.Scene.IScene.UnloadContent()') + + + +### Update(FrameTime) + +Updates the object. + +```csharp +public virtual void Update(Velaptor.FrameTime frameTime); +``` +#### Parameters + + + +`frameTime` [FrameTime](Velaptor.FrameTime.md 'Velaptor.FrameTime') + +The amount of time that has passed for the current frame. + +Implements [Update(FrameTime)](Velaptor.IUpdatable.md#Velaptor.IUpdatable.Update(Velaptor.FrameTime) 'Velaptor.IUpdatable.Update(Velaptor.FrameTime)') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.md new file mode 100644 index 00000000..4a4bfba8 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.Scene.md @@ -0,0 +1,16 @@ +--- +title: Velaptor.Scene +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.Scene Namespace + +| Classes | | +| :--- | :--- | +| [SceneBase](Velaptor.Scene.SceneBase.md 'Velaptor.Scene.SceneBase') | A base scene to be used for creating new custom scenes. | + +| Interfaces | | +| :--- | :--- | +| [IScene](Velaptor.Scene.IScene.md 'Velaptor.Scene.IScene') | Represents a single scene that can be rendered to the screen. | +| [ISceneManager](Velaptor.Scene.ISceneManager.md 'Velaptor.Scene.ISceneManager') | Manages scenes by loading and unloading content, updating, and rendering scenes. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.SizeU.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.SizeU.md new file mode 100644 index 00000000..b3f67000 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.SizeU.md @@ -0,0 +1,68 @@ +--- +title: Velaptor.SizeU +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +#### SizeU Struct + +Stores an ordered pair of [unsigned](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/unsigned 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/unsigned') integers, which specify a [Width](Velaptor.SizeU.md#Velaptor.SizeU.Width 'Velaptor.SizeU.Width') and [Height](Velaptor.SizeU.md#Velaptor.SizeU.Height 'Velaptor.SizeU.Height'). + +```csharp +public readonly struct SizeU : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[SizeU](Velaptor.SizeU.md 'Velaptor.SizeU')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Constructors + + + +### SizeU(uint, uint) Constructor + +Initializes a new instance of the [SizeU](Velaptor.SizeU.md 'Velaptor.SizeU') struct. + +```csharp +public SizeU(uint width, uint height); +``` +#### Parameters + + + +`width` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The width of the size. + + + +`height` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The height of the size. +## Properties + + + +### Height + +Gets the height of the size. + +```csharp +public uint Height { get; set; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Width + +Gets the width of the size. + +```csharp +public uint Width { get; set; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.StateOfWindow.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.StateOfWindow.md new file mode 100644 index 00000000..48942c3f --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.StateOfWindow.md @@ -0,0 +1,42 @@ +--- +title: Velaptor.StateOfWindow +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +## StateOfWindow Enum + +The different states that a [Window](Velaptor.UI.Window.md 'Velaptor.UI.Window') can be in. + +```csharp +public enum StateOfWindow +``` +#### Fields + + + +`FullScreen` 3 + +The window covers the whole screen, including all task bars and/or panels. + + + +`Maximized` 2 + +The window covers the whole working area, which includes the desktop but not the taskbar and/or panels. + + + +`Minimized` 1 + +The window is minimized to the taskbar. + +#### Remarks +This is also known as .iconified'. + + + +`Normal` 0 + +The window is in the normal state. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Button.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Button.md new file mode 100644 index 00000000..57b7f3b3 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Button.md @@ -0,0 +1,410 @@ +--- +title: Velaptor.UI.Button +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.UI](Velaptor.UI.md 'Velaptor.UI') + +#### Button Class + +A button that can be clicked to execute functionality. + +```csharp +public sealed class Button : Velaptor.UI.ControlBase +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase') โ†’ Button +## Constructors + + + +### Button() Constructor + +Initializes a new instance of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') class. + +```csharp +public Button(); +``` + + + +### Button(Point, uint, uint, Label) Constructor + +Initializes a new instance of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') class. + +```csharp +public Button(System.Drawing.Point position, uint width, uint height, Velaptor.UI.Label? label); +``` +#### Parameters + + + +`position` [System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + +The position of the button. + + + +`width` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The width of the button. + + + +`height` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The height of the button. + + + +`label` [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') + +The label to display on the face of the button. + + + +### Button(Point, uint, uint) Constructor + +Initializes a new instance of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') class. + +```csharp +public Button(System.Drawing.Point position, uint width, uint height); +``` +#### Parameters + + + +`position` [System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + +The position of the button. + + + +`width` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The width of the button. + + + +`height` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The height of the button. + + + +### Button(Point) Constructor + +Initializes a new instance of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') class. + +```csharp +public Button(System.Drawing.Point position); +``` +#### Parameters + + + +`position` [System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + +The position of the button. + + + +### Button(uint, uint, Label) Constructor + +Initializes a new instance of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') class. + +```csharp +public Button(uint width, uint height, Velaptor.UI.Label? label); +``` +#### Parameters + + + +`width` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The width of the button. + + + +`height` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The height of the button. + + + +`label` [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') + +The label to display on the face of the button. + + + +### Button(uint, uint) Constructor + +Initializes a new instance of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') class. + +```csharp +public Button(uint width, uint height); +``` +#### Parameters + + + +`width` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The width of the button. + + + +`height` [System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +The height of the button. + + + +### Button(Label) Constructor + +Initializes a new instance of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') class. + +```csharp +public Button(Velaptor.UI.Label? label); +``` +#### Parameters + + + +`label` [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') + +The label to display on the face of the button. +## Properties + + + +### AutoSize + +Gets or sets a value indicating whether or not the size of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') will be +managed automatically based on the size of the [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label'). + +```csharp +public bool AutoSize { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Remarks +If [AutoSize](Velaptor.UI.Button.md#Velaptor.UI.Button.AutoSize 'Velaptor.UI.Button.AutoSize') is `false`, the user can set the size to anything they +desire. If the size is less than the width or height of the text, then only the text characters +that are still within the bounds of the [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') will be rendered. + + + +### BorderColor + +Gets or sets the color of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') border. + +```csharp +public System.Drawing.Color BorderColor { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### BorderThickness + +Gets or sets the thickness of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button')'s border. + +```csharp +public uint BorderThickness { get; set; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +#### Remarks +This value uses pixels as unit of measure. + + + +### BorderVisible + +Gets or sets a value indicating whether or not the border of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') is visible. + +```csharp +public bool BorderVisible { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### CornerRadius + +Gets or sets the radius values for each corner of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') +border and face. + +```csharp +public Velaptor.Graphics.CornerRadius CornerRadius { get; set; } +``` + +#### Property Value +[CornerRadius](Velaptor.Graphics.CornerRadius.md 'Velaptor.Graphics.CornerRadius') + + + +### Enabled + +Gets or sets a value indicating whether or not the button is enabled. + +```csharp +public override bool Enabled { get; set; } +``` + +Implements [Enabled](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Enabled 'Velaptor.UI.IControl.Enabled') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### FaceColor + +Gets or sets the color of the face of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button'). + +```csharp +public System.Drawing.Color FaceColor { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### FontSize + +Gets or sets the font size of the text on the face of the button. + +```csharp +public uint FontSize { get; set; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Height + +Gets or sets the [Height](Velaptor.UI.Button.md#Velaptor.UI.Button.Height 'Velaptor.UI.Button.Height') of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button'). + +```csharp +public override uint Height { get; set; } +``` + +Implements [Height](Velaptor.UI.ISizable.md#Velaptor.UI.ISizable.Height 'Velaptor.UI.ISizable.Height') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +#### Remarks +If [AutoSize](Velaptor.UI.Button.md#Velaptor.UI.Button.AutoSize 'Velaptor.UI.Button.AutoSize') is `true`, the [Height](Velaptor.UI.Button.md#Velaptor.UI.Button.Height 'Velaptor.UI.Button.Height') value will be set but ignored +and the [Height](Velaptor.UI.Button.md#Velaptor.UI.Button.Height 'Velaptor.UI.Button.Height') will be automatic based on the [Height](Velaptor.UI.Button.md#Velaptor.UI.Button.Height 'Velaptor.UI.Button.Height') of the [Text](Velaptor.UI.Button.md#Velaptor.UI.Button.Text 'Velaptor.UI.Button.Text'). + + + +### Label + +Gets the [Label](Velaptor.UI.Button.md#Velaptor.UI.Button.Label 'Velaptor.UI.Button.Label') of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button'). + +```csharp +public Velaptor.UI.Label? Label { get; set; } +``` + +#### Property Value +[Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') + + + +### Position + +A user interface object that can be updated and rendered to the screen. + +```csharp +public override System.Drawing.Point Position { get; set; } +``` + +Implements [Position](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Position 'Velaptor.UI.IControl.Position') + +#### Property Value +[System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + + + +### Text + +Gets or sets the text of the button. + +```csharp +public string Text { get; set; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Width + +Gets or sets the [Width](Velaptor.UI.Button.md#Velaptor.UI.Button.Width 'Velaptor.UI.Button.Width') of the [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button'). + +```csharp +public override uint Width { get; set; } +``` + +Implements [Width](Velaptor.UI.ISizable.md#Velaptor.UI.ISizable.Width 'Velaptor.UI.ISizable.Width') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + +#### Remarks +If [AutoSize](Velaptor.UI.Button.md#Velaptor.UI.Button.AutoSize 'Velaptor.UI.Button.AutoSize') is `true`, the [Width](Velaptor.UI.Button.md#Velaptor.UI.Button.Width 'Velaptor.UI.Button.Width') value will be set but ignored +and the [Width](Velaptor.UI.Button.md#Velaptor.UI.Button.Width 'Velaptor.UI.Button.Width') will be automatic based on the [Width](Velaptor.UI.Button.md#Velaptor.UI.Button.Width 'Velaptor.UI.Button.Width') of the [Text](Velaptor.UI.Button.md#Velaptor.UI.Button.Text 'Velaptor.UI.Button.Text'). +## Methods + + + +### LoadContent() + +Unloads the content for an object. + +```csharp +public override void LoadContent(); +``` + +Implements [LoadContent()](Velaptor.Content.IContentLoadable.md#Velaptor.Content.IContentLoadable.LoadContent() 'Velaptor.Content.IContentLoadable.LoadContent()') + + + +### Render() + +Renders the object. + +```csharp +public override void Render(); +``` + +Implements [Render()](Velaptor.IDrawable.md#Velaptor.IDrawable.Render() 'Velaptor.IDrawable.Render()') + + + +### UnloadContent() + +Unloads the content for an object. + +```csharp +public override void UnloadContent(); +``` + +Implements [UnloadContent()](Velaptor.Content.IContentLoadable.md#Velaptor.Content.IContentLoadable.UnloadContent() 'Velaptor.Content.IContentLoadable.UnloadContent()') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.ControlBase.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.ControlBase.md new file mode 100644 index 00000000..db151b2e --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.ControlBase.md @@ -0,0 +1,412 @@ +--- +title: Velaptor.UI.ControlBase +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.UI](Velaptor.UI.md 'Velaptor.UI') + +#### ControlBase Class + +Represents a basic control with behavior that is shared among all controls. + +```csharp +public abstract class ControlBase : +Velaptor.UI.IControl, +Velaptor.IUpdatable, +Velaptor.IDrawable, +Velaptor.Content.IContentLoadable, +Velaptor.UI.ISizable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ ControlBase + +Derived +↳ [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') +↳ [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') +↳ [TextBox](Velaptor.UI.TextBox.md 'Velaptor.UI.TextBox') + +Implements [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl'), [IUpdatable](Velaptor.IUpdatable.md 'Velaptor.IUpdatable'), [IDrawable](Velaptor.IDrawable.md 'Velaptor.IDrawable'), [IContentLoadable](Velaptor.Content.IContentLoadable.md 'Velaptor.Content.IContentLoadable'), [ISizable](Velaptor.UI.ISizable.md 'Velaptor.UI.ISizable') +## Properties + + + +### Bottom + +Gets or sets the position of the bottom of the control. + +```csharp +public virtual int Bottom { get; set; } +``` + +Implements [Bottom](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Bottom 'Velaptor.UI.IControl.Bottom') + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Enabled + +Gets or sets a value indicating whether or not the control is enabled. + +```csharp +public virtual bool Enabled { get; set; } +``` + +Implements [Enabled](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Enabled 'Velaptor.UI.IControl.Enabled') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### HalfHeight + +Gets the half height of the [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase'). + +```csharp +public virtual uint HalfHeight { get; } +``` + +Implements [HalfHeight](Velaptor.UI.ISizable.md#Velaptor.UI.ISizable.HalfHeight 'Velaptor.UI.ISizable.HalfHeight') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### HalfWidth + +Gets the half width of the [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase'). + +```csharp +public virtual uint HalfWidth { get; } +``` + +Implements [HalfWidth](Velaptor.UI.ISizable.md#Velaptor.UI.ISizable.HalfWidth 'Velaptor.UI.ISizable.HalfWidth') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Height + +Gets or sets the height of the [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase'). + +```csharp +public virtual uint Height { get; set; } +``` + +Implements [Height](Velaptor.UI.ISizable.md#Velaptor.UI.ISizable.Height 'Velaptor.UI.ISizable.Height') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### IsLoaded + +Gets a value indicating whether or not the content for an object is loaded. + +```csharp +public bool IsLoaded { get; set; } +``` + +Implements [IsLoaded](Velaptor.Content.IContentLoadable.md#Velaptor.Content.IContentLoadable.IsLoaded 'Velaptor.Content.IContentLoadable.IsLoaded') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### IsMouseOver + +Gets a value indicating whether or not the mouse is hovering over the button. + +```csharp +public bool IsMouseOver { get; set; } +``` + +Implements [IsMouseOver](Velaptor.UI.IControl.md#Velaptor.UI.IControl.IsMouseOver 'Velaptor.UI.IControl.IsMouseOver') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Left + +Gets or sets the position of the left side of the control. + +```csharp +public virtual int Left { get; set; } +``` + +Implements [Left](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Left 'Velaptor.UI.IControl.Left') + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### MouseDownColor + +Gets or sets the color to apply to the control when the +mouse button is in the down position over the control. + +```csharp +public System.Drawing.Color MouseDownColor { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### MouseHoverColor + +Gets or sets the color to apply to the control when the mouse button is hovering over the control. + +```csharp +public System.Drawing.Color MouseHoverColor { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### Name + +Gets or sets the name of the control. + +```csharp +public string Name { get; set; } +``` + +Implements [Name](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Name 'Velaptor.UI.IControl.Name') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Position + +Gets or sets the position of the [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') on the screen. + +```csharp +public virtual System.Drawing.Point Position { get; set; } +``` + +Implements [Position](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Position 'Velaptor.UI.IControl.Position') + +#### Property Value +[System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + + + +### Right + +Gets or sets the position of the right side of the control. + +```csharp +public virtual int Right { get; set; } +``` + +Implements [Right](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Right 'Velaptor.UI.IControl.Right') + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Top + +Gets or sets the position of the top of the control. + +```csharp +public virtual int Top { get; set; } +``` + +Implements [Top](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Top 'Velaptor.UI.IControl.Top') + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Visible + +Gets or sets a value indicating whether or not the control is visible. + +```csharp +public virtual bool Visible { get; set; } +``` + +Implements [Visible](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Visible 'Velaptor.UI.IControl.Visible') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Width + +Gets or sets the width of the [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase'). + +```csharp +public virtual uint Width { get; set; } +``` + +Implements [Width](Velaptor.UI.ISizable.md#Velaptor.UI.ISizable.Width 'Velaptor.UI.ISizable.Width') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') +## Methods + + + +### LoadContent() + +Unloads the content for an object. + +```csharp +public virtual void LoadContent(); +``` + +Implements [LoadContent()](Velaptor.Content.IContentLoadable.md#Velaptor.Content.IContentLoadable.LoadContent() 'Velaptor.Content.IContentLoadable.LoadContent()') + + + +### Render() + +Renders the control to the screen. + +```csharp +public virtual void Render(); +``` + +Implements [Render()](Velaptor.IDrawable.md#Velaptor.IDrawable.Render() 'Velaptor.IDrawable.Render()') + + + +### UnloadContent() + +Unloads the content for an object. + +```csharp +public virtual void UnloadContent(); +``` + +Implements [UnloadContent()](Velaptor.Content.IContentLoadable.md#Velaptor.Content.IContentLoadable.UnloadContent() 'Velaptor.Content.IContentLoadable.UnloadContent()') + + + +### Update(FrameTime) + +A user interface object that can be updated and rendered to the screen. + +```csharp +public virtual void Update(Velaptor.FrameTime frameTime); +``` +#### Parameters + + + +`frameTime` [FrameTime](Velaptor.FrameTime.md 'Velaptor.FrameTime') + +Implements [Update(FrameTime)](Velaptor.IUpdatable.md#Velaptor.IUpdatable.Update(Velaptor.FrameTime) 'Velaptor.IUpdatable.Update(Velaptor.FrameTime)') +### Events + + + +## ControlBase.Click Event + +Occurs when the button has been clicked. + +```csharp +public event EventHandler? Click; +``` + +Implements [Click](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Click 'Velaptor.UI.IControl.Click') + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[System.EventArgs](https://docs.microsoft.com/en-us/dotnet/api/System.EventArgs 'System.EventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') + + + +## ControlBase.KeyDown Event + +Occurs when a keyboard key is pressed into the down position. + +```csharp +public event EventHandler? KeyDown; +``` + +Implements [KeyDown](Velaptor.UI.IControl.md#Velaptor.UI.IControl.KeyDown 'Velaptor.UI.IControl.KeyDown') + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[KeyEventArgs](Velaptor.Input.KeyEventArgs.md 'Velaptor.Input.KeyEventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') + + + +## ControlBase.KeyUp Event + +Occurs when a keyboard key is released into the up position. + +```csharp +public event EventHandler? KeyUp; +``` + +Implements [KeyUp](Velaptor.UI.IControl.md#Velaptor.UI.IControl.KeyUp 'Velaptor.UI.IControl.KeyUp') + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[KeyEventArgs](Velaptor.Input.KeyEventArgs.md 'Velaptor.Input.KeyEventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') + + + +## ControlBase.MouseDown Event + +Occurs when the left mouse button is in the down position over the button. + +```csharp +public event EventHandler? MouseDown; +``` + +Implements [MouseDown](Velaptor.UI.IControl.md#Velaptor.UI.IControl.MouseDown 'Velaptor.UI.IControl.MouseDown') + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[System.EventArgs](https://docs.microsoft.com/en-us/dotnet/api/System.EventArgs 'System.EventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') + + + +## ControlBase.MouseMove Event + +Occurs when the mouse moves over the button. + +```csharp +public event EventHandler? MouseMove; +``` + +Implements [MouseMove](Velaptor.UI.IControl.md#Velaptor.UI.IControl.MouseMove 'Velaptor.UI.IControl.MouseMove') + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[MouseMoveEventArgs](Velaptor.UI.MouseMoveEventArgs.md 'Velaptor.UI.MouseMoveEventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') + + + +## ControlBase.MouseUp Event + +Occurs when the left mouse button is in the up position over the button +after the mouse has been in the down position. + +```csharp +public event EventHandler? MouseUp; +``` + +Implements [MouseUp](Velaptor.UI.IControl.md#Velaptor.UI.IControl.MouseUp 'Velaptor.UI.IControl.MouseUp') + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[System.EventArgs](https://docs.microsoft.com/en-us/dotnet/api/System.EventArgs 'System.EventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.IControl.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.IControl.md new file mode 100644 index 00000000..3aec7370 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.IControl.md @@ -0,0 +1,221 @@ +--- +title: Velaptor.UI.IControl +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.UI](Velaptor.UI.md 'Velaptor.UI') + +#### IControl Interface + +A user interface object that can be updated and rendered to the screen. + +```csharp +public interface IControl : +Velaptor.IUpdatable, +Velaptor.IDrawable, +Velaptor.Content.IContentLoadable, +Velaptor.UI.ISizable +``` + +Derived +↳ [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase') + +Implements [IUpdatable](Velaptor.IUpdatable.md 'Velaptor.IUpdatable'), [IDrawable](Velaptor.IDrawable.md 'Velaptor.IDrawable'), [IContentLoadable](Velaptor.Content.IContentLoadable.md 'Velaptor.Content.IContentLoadable'), [ISizable](Velaptor.UI.ISizable.md 'Velaptor.UI.ISizable') +## Properties + + + +### Bottom + +Gets or sets the position of the bottom of the control. + +```csharp +int Bottom { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Enabled + +Gets or sets a value indicating whether or not the control is enabled. + +```csharp +bool Enabled { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### IsMouseOver + +Gets a value indicating whether or not the mouse is hovering over the button. + +```csharp +bool IsMouseOver { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Left + +Gets or sets the position of the left side of the control. + +```csharp +int Left { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Name + +Gets or sets the name of the control. + +```csharp +string Name { get; set; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Position + +Gets or sets the position of the [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') on the screen. + +```csharp +System.Drawing.Point Position { get; set; } +``` + +#### Property Value +[System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + + + +### Right + +Gets or sets the position of the right side of the control. + +```csharp +int Right { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Top + +Gets or sets the position of the top of the control. + +```csharp +int Top { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Visible + +Gets or sets a value indicating whether or not the control is visible. + +```csharp +bool Visible { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +### Events + + + +## IControl.Click Event + +Occurs when the button has been clicked. + +```csharp +event EventHandler? Click; +``` + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[System.EventArgs](https://docs.microsoft.com/en-us/dotnet/api/System.EventArgs 'System.EventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') + + + +## IControl.KeyDown Event + +Occurs when a keyboard key is pressed into the down position. + +```csharp +event EventHandler? KeyDown; +``` + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[KeyEventArgs](Velaptor.Input.KeyEventArgs.md 'Velaptor.Input.KeyEventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') + + + +## IControl.KeyUp Event + +Occurs when a keyboard key is released into the up position. + +```csharp +event EventHandler? KeyUp; +``` + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[KeyEventArgs](Velaptor.Input.KeyEventArgs.md 'Velaptor.Input.KeyEventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') + + + +## IControl.MouseDown Event + +Occurs when the left mouse button is in the down position over the button. + +```csharp +event EventHandler? MouseDown; +``` + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[System.EventArgs](https://docs.microsoft.com/en-us/dotnet/api/System.EventArgs 'System.EventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') + + + +## IControl.MouseMove Event + +Occurs when the mouse moves over the button. + +```csharp +event EventHandler? MouseMove; +``` + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[MouseMoveEventArgs](Velaptor.UI.MouseMoveEventArgs.md 'Velaptor.UI.MouseMoveEventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') + + + +## IControl.MouseUp Event + +Occurs when the left mouse button is in the up position over the button +after the mouse has been in the down position. + +```csharp +event EventHandler? MouseUp; +``` + +#### Event Type +[System.EventHandler<](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1')[System.EventArgs](https://docs.microsoft.com/en-us/dotnet/api/System.EventArgs 'System.EventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.EventHandler-1 'System.EventHandler`1') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.ISizable.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.ISizable.md new file mode 100644 index 00000000..0fb98be9 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.ISizable.md @@ -0,0 +1,71 @@ +--- +title: Velaptor.UI.ISizable +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.UI](Velaptor.UI.md 'Velaptor.UI') + +#### ISizable Interface + +Represents the size of an object by its width and height. + +```csharp +public interface ISizable +``` + +Derived +↳ [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase') +↳ [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') +## Properties + + + +### HalfHeight + +Gets the half height of the [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl'). + +```csharp +uint HalfHeight { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### HalfWidth + +Gets the half width of the [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl'). + +```csharp +uint HalfWidth { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Height + +Gets the height of the [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl'). + +```csharp +uint Height { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Width + +Gets the width of the [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl'). + +```csharp +uint Width { get; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.IWindow.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.IWindow.md new file mode 100644 index 00000000..8c0950aa --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.IWindow.md @@ -0,0 +1,357 @@ +--- +title: Velaptor.UI.IWindow +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.UI](Velaptor.UI.md 'Velaptor.UI') + +#### IWindow Interface + +Provides the core of an application window which facilitates how the +window behaves, its state and the ability to be used in various types +of applications. + +```csharp +public interface IWindow : +System.IDisposable +``` + +Derived +↳ [Window](Velaptor.UI.Window.md 'Velaptor.UI.Window') + +Implements [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable') +## Properties + + + +### AutoClearBuffer + +Gets or sets a value indicating whether or not the buffers should +be automatically cleared before rendering any textures. + +```csharp +bool AutoClearBuffer { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Remarks + +If this is set to true, it means you do not have to +use or invoke the [Clear()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Clear() 'Velaptor.Batching.IBatcher.Clear()')() method. + +Set to the value of `false` if you want more control when +the back buffers will be cleared. + +WARNING!! - To prevent performance issues, do not manually clear the +buffer with the [Clear()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Clear() 'Velaptor.Batching.IBatcher.Clear()')() method +and set this property to true. That would be a waste of resources. + + + +### AutoSceneLoading + +Gets or sets a value indicating whether or not the scenes should be automatically loaded. + +```csharp +bool AutoSceneLoading { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### AutoSceneRendering + +Gets or sets a value indicating whether or not the scenes should be automatically rendered. + +```csharp +bool AutoSceneRendering { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### AutoSceneUnloading + +Gets or sets a value indicating whether or not the scenes should be automatically unloaded. + +```csharp +bool AutoSceneUnloading { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### AutoSceneUpdating + +Gets or sets a value indicating whether or not the scenes should be automatically updated. + +```csharp +bool AutoSceneUpdating { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Draw + +Gets or sets the [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate that is invoked per frame for rendering. + +```csharp +System.Action? Draw { get; set; } +``` + +#### Property Value +[System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[FrameTime](Velaptor.FrameTime.md 'Velaptor.FrameTime')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') + + + +### Fps + +Gets the frames per second that the main loop is running at. + +```csharp +float Fps { get; } +``` + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### Height + +Gets or sets the height of the window. + +```csharp +uint Height { get; set; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Initialize + +Gets or sets the [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate to be invoked one time to initialize the window. + +```csharp +System.Action? Initialize { get; set; } +``` + +#### Property Value +[System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') + + + +### Initialized + +Gets a value indicating whether or not the window has been initialized. + +```csharp +bool Initialized { get; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### MouseCursorVisible + +Gets or sets a value indicating whether or not the mouse cursor is visible. + +```csharp +bool MouseCursorVisible { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Position + +Gets or sets the position of the window. + +```csharp +System.Numerics.Vector2 Position { get; set; } +``` + +#### Property Value +[System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + + + +### SceneManager + +Gets the scene manager. + +```csharp +Velaptor.Scene.ISceneManager SceneManager { get; } +``` + +#### Property Value +[ISceneManager](Velaptor.Scene.ISceneManager.md 'Velaptor.Scene.ISceneManager') + + + +### Title + +Gets or sets the title of the window. + +```csharp +string Title { get; set; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### TypeOfBorder + +Gets or sets the type of border that the [IWindow](Velaptor.UI.IWindow.md 'Velaptor.UI.IWindow') will have. + +```csharp +Velaptor.WindowBorder TypeOfBorder { get; set; } +``` + +#### Property Value +[WindowBorder](Velaptor.WindowBorder.md 'Velaptor.WindowBorder') + + + +### Uninitialize + +Gets or sets the [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate to be invoked one time to uninitialize the window. + +```csharp +System.Action? Uninitialize { get; set; } +``` + +#### Property Value +[System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') + + + +### Update + +Gets or sets the [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate that is invoked per frame for updating. + +```csharp +System.Action? Update { get; set; } +``` + +#### Property Value +[System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[FrameTime](Velaptor.FrameTime.md 'Velaptor.FrameTime')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') + + + +### UpdateFrequency + +Gets or sets the value of how often the update and render calls are invoked in the value of hertz. + +```csharp +int UpdateFrequency { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Width + +Gets or sets the width of the window. + +```csharp +uint Width { get; set; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### WindowState + +Gets or sets the state of the window. + +```csharp +Velaptor.StateOfWindow WindowState { get; set; } +``` + +#### Property Value +[StateOfWindow](Velaptor.StateOfWindow.md 'Velaptor.StateOfWindow') + + + +### WinResize + +Gets or sets the [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate that is invoked every time the window is resized. + +```csharp +System.Action? WinResize { get; set; } +``` + +#### Property Value +[System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[SizeU](Velaptor.SizeU.md 'Velaptor.SizeU')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') +## Methods + + + +### Close() + +Closes the window. + +```csharp +void Close(); +``` + + + +### Show() + +Shows the window. + +```csharp +void Show(); +``` + + + +### ShowAsync(Action, Action) + +Shows the window asynchronously. + +```csharp +System.Threading.Tasks.Task ShowAsync(System.Action? afterStart=null, System.Action? afterUnload=null); +``` +#### Parameters + + + +`afterStart` [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') + +Executed after the application starts asynchronously. + + + +`afterUnload` [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') + +Executed after the window has been unloaded. + +#### Returns +[System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task') +A [System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task') representing the result of the asynchronous operation. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Label.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Label.md new file mode 100644 index 00000000..67e11704 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Label.md @@ -0,0 +1,224 @@ +--- +title: Velaptor.UI.Label +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.UI](Velaptor.UI.md 'Velaptor.UI') + +#### Label Class + +A label that renders text on the screen. + +```csharp +public class Label : Velaptor.UI.ControlBase +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase') โ†’ Label +## Constructors + + + +### Label() Constructor + +Initializes a new instance of the [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') class. + +```csharp +public Label(); +``` + + + +### Label(string) Constructor + +Initializes a new instance of the [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') class. + +```csharp +public Label(string text); +``` +#### Parameters + + + +`text` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +The text of the label. +## Properties + + + +### AutoSize + +Gets or sets a value indicating whether or not the size of the [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') will be +managed automatically based on the size of the text. + +```csharp +public bool AutoSize { get; set; } +``` + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Remarks +If [AutoSize](Velaptor.UI.Label.md#Velaptor.UI.Label.AutoSize 'Velaptor.UI.Label.AutoSize') is `false`, it means that the user can set the size to what they +want. If the size is less than the width or height of the text, then only the text characters +that are still within the bounds of the [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') will be rendered. + + + +### CharacterBounds + +Gets a list of all the bounds for each character of the [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label').[Text](Velaptor.UI.Label.md#Velaptor.UI.Label.Text 'Velaptor.UI.Label.Text'). + +```csharp +public System.Collections.Generic.IReadOnlyCollection<(char character,System.Drawing.RectangleF bounds)> CharacterBounds { get; } +``` + +#### Property Value +[System.Collections.Generic.IReadOnlyCollection<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1')[<](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Char](https://docs.microsoft.com/en-us/dotnet/api/System.Char 'System.Char')[,](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[System.Drawing.RectangleF](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.RectangleF 'System.Drawing.RectangleF')[>](https://docs.microsoft.com/en-us/dotnet/api/System.ValueTuple 'System.ValueTuple')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IReadOnlyCollection-1 'System.Collections.Generic.IReadOnlyCollection`1') + + + +### Color + +Gets or sets the color of the text. + +```csharp +public System.Drawing.Color Color { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### FontFamilyName + +Gets the font family name. + +```csharp +public string FontFamilyName { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### FontSize + +Gets or sets the font size. + +```csharp +public uint FontSize { get; set; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Height + +Gets or sets the height of the [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label'). + +```csharp +public override uint Height { get; set; } +``` + +Implements [Height](Velaptor.UI.ISizable.md#Velaptor.UI.ISizable.Height 'Velaptor.UI.ISizable.Height') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Position + +Gets or sets the position of the [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') on the screen. + +```csharp +public override System.Drawing.Point Position { get; set; } +``` + +Implements [Position](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Position 'Velaptor.UI.IControl.Position') + +#### Property Value +[System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + + + +### Style + +Gets or sets the font style of the text. + +```csharp +public Velaptor.Content.Fonts.FontStyle Style { get; set; } +``` + +#### Property Value +[FontStyle](Velaptor.Content.Fonts.FontStyle.md 'Velaptor.Content.Fonts.FontStyle') + + + +### Text + +Gets or sets the labelText of the label. + +```csharp +public string Text { get; set; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### Width + +Gets or sets the width of the [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label'). + +```csharp +public override uint Width { get; set; } +``` + +Implements [Width](Velaptor.UI.ISizable.md#Velaptor.UI.ISizable.Width 'Velaptor.UI.ISizable.Width') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') +## Methods + + + +### LoadContent() + +Unloads the content for an object. + +```csharp +public override void LoadContent(); +``` + +Implements [LoadContent()](Velaptor.Content.IContentLoadable.md#Velaptor.Content.IContentLoadable.LoadContent() 'Velaptor.Content.IContentLoadable.LoadContent()') + + + +### Render() + +Renders the [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label'). + +```csharp +public override void Render(); +``` + +Implements [Render()](Velaptor.IDrawable.md#Velaptor.IDrawable.Render() 'Velaptor.IDrawable.Render()') + + + +### UnloadContent() + +Unloads the content for an object. + +```csharp +public override void UnloadContent(); +``` + +Implements [UnloadContent()](Velaptor.Content.IContentLoadable.md#Velaptor.Content.IContentLoadable.UnloadContent() 'Velaptor.Content.IContentLoadable.UnloadContent()') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.MouseMoveEventArgs.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.MouseMoveEventArgs.md new file mode 100644 index 00000000..403d2ad2 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.MouseMoveEventArgs.md @@ -0,0 +1,68 @@ +--- +title: Velaptor.UI.MouseMoveEventArgs +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.UI](Velaptor.UI.md 'Velaptor.UI') + +#### MouseMoveEventArgs Struct + +Holds information about the mouse position over a control. + +```csharp +public readonly struct MouseMoveEventArgs : +System.IEquatable +``` + +Implements [System.IEquatable<](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1')[MouseMoveEventArgs](Velaptor.UI.MouseMoveEventArgs.md 'Velaptor.UI.MouseMoveEventArgs')[>](https://docs.microsoft.com/en-us/dotnet/api/System.IEquatable-1 'System.IEquatable`1') +## Constructors + + + +### MouseMoveEventArgs(Point, Point) Constructor + +Initializes a new instance of the [MouseMoveEventArgs](Velaptor.UI.MouseMoveEventArgs.md 'Velaptor.UI.MouseMoveEventArgs') struct. + +```csharp +public MouseMoveEventArgs(System.Drawing.Point globalPos, System.Drawing.Point localPos); +``` +#### Parameters + + + +`globalPos` [System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + +The global position of the mouse. + + + +`localPos` [System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + +The local position of the mouse. +## Properties + + + +### GlobalPos + +Gets the position of the mouse relative to the top left corner of the window. + +```csharp +public System.Drawing.Point GlobalPos { get; } +``` + +#### Property Value +[System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + + + +### LocalPos + +Gets the position of the mouse relative to the top left corner of the control. + +```csharp +public System.Drawing.Point LocalPos { get; } +``` + +#### Property Value +[System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.TextBox.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.TextBox.md new file mode 100644 index 00000000..6024d5b1 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.TextBox.md @@ -0,0 +1,221 @@ +--- +title: Velaptor.UI.TextBox +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.UI](Velaptor.UI.md 'Velaptor.UI') + +#### TextBox Class + +Provides the ability to enter text into a box. + +```csharp +public sealed class TextBox : Velaptor.UI.ControlBase +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase') โ†’ TextBox +## Constructors + + + +### TextBox() Constructor + +Initializes a new instance of the [TextBox](Velaptor.UI.TextBox.md 'Velaptor.UI.TextBox') class. + +```csharp +public TextBox(); +``` +## Properties + + + +### CursorColor + +Gets or sets the color of the cursor. + +```csharp +public System.Drawing.Color CursorColor { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### CursorWidth + +Gets or sets the width of the cursor. + +```csharp +public int CursorWidth { get; set; } +``` + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### FontSize + +Gets or sets the size of the font of the text box. + +```csharp +public uint FontSize { get; set; } +``` + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Height + +Gets the height of the [TextBox](Velaptor.UI.TextBox.md 'Velaptor.UI.TextBox'). + +```csharp +public override uint Height { get; } +``` + +Implements [Height](Velaptor.UI.ISizable.md#Velaptor.UI.ISizable.Height 'Velaptor.UI.ISizable.Height') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Position + +Gets or sets the position of the [TextBox](Velaptor.UI.TextBox.md 'Velaptor.UI.TextBox') on the screen. + +```csharp +public override System.Drawing.Point Position { get; set; } +``` + +Implements [Position](Velaptor.UI.IControl.md#Velaptor.UI.IControl.Position 'Velaptor.UI.IControl.Position') + +#### Property Value +[System.Drawing.Point](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Point 'System.Drawing.Point') + + + +### SelectedText + +Gets the selected text. + +```csharp +public string SelectedText { get; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### SelectedTextColor + +Gets or sets the color of the selected text. + +```csharp +public System.Drawing.Color SelectedTextColor { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### SelectionColor + +Gets or sets the color of the text selection rectangle. + +```csharp +public System.Drawing.Color SelectionColor { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### Text + +Gets or sets the text in the [TextBox](Velaptor.UI.TextBox.md 'Velaptor.UI.TextBox'). + +```csharp +public string Text { get; set; } +``` + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### TextColor + +Gets or sets the color of the text. + +```csharp +public System.Drawing.Color TextColor { get; set; } +``` + +#### Property Value +[System.Drawing.Color](https://docs.microsoft.com/en-us/dotnet/api/System.Drawing.Color 'System.Drawing.Color') + + + +### Width + +Gets or sets the width of the [TextBox](Velaptor.UI.TextBox.md 'Velaptor.UI.TextBox'). + +```csharp +public override uint Width { get; set; } +``` + +Implements [Width](Velaptor.UI.ISizable.md#Velaptor.UI.ISizable.Width 'Velaptor.UI.ISizable.Width') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') +## Methods + + + +### LoadContent() + +Loads the content of the [TextBox](Velaptor.UI.TextBox.md 'Velaptor.UI.TextBox'). + +```csharp +public override void LoadContent(); +``` + +Implements [LoadContent()](Velaptor.Content.IContentLoadable.md#Velaptor.Content.IContentLoadable.LoadContent() 'Velaptor.Content.IContentLoadable.LoadContent()') + + + +### Render() + +Renders the control to the screen. + +```csharp +public override void Render(); +``` + +Implements [Render()](Velaptor.IDrawable.md#Velaptor.IDrawable.Render() 'Velaptor.IDrawable.Render()') + + + +### Update(FrameTime) + +Updates the text box. + +```csharp +public override void Update(Velaptor.FrameTime frameTime); +``` +#### Parameters + + + +`frameTime` [FrameTime](Velaptor.FrameTime.md 'Velaptor.FrameTime') + +The amount of time that has passed for the current frame. + +Implements [Update(FrameTime)](Velaptor.IUpdatable.md#Velaptor.IUpdatable.Update(Velaptor.FrameTime) 'Velaptor.IUpdatable.Update(Velaptor.FrameTime)') \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Window.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Window.md new file mode 100644 index 00000000..f39bc12d --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.Window.md @@ -0,0 +1,418 @@ +--- +title: Velaptor.UI.Window +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor.UI](Velaptor.UI.md 'Velaptor.UI') + +#### Window Class + +A system window where graphics can be rendered. + +```csharp +public abstract class Window : +Velaptor.UI.IWindow, +System.IDisposable +``` + +Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') โ†’ Window + +Implements [IWindow](Velaptor.UI.IWindow.md 'Velaptor.UI.IWindow'), [System.IDisposable](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable 'System.IDisposable') +## Properties + + + +### AutoClearBuffer + +Gets or sets a value indicating whether or not the buffers should +be automatically cleared before rendering any textures. + +```csharp +public bool AutoClearBuffer { get; set; } +``` + +Implements [AutoClearBuffer](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.AutoClearBuffer 'Velaptor.UI.IWindow.AutoClearBuffer') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + +#### Remarks + +If this is set to true, it means you do not have to +use or invoke the [Clear()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Clear() 'Velaptor.Batching.IBatcher.Clear()')() method. + +Set to the value of `false` if you want more control when +the back buffers will be cleared. + +WARNING!! - To prevent performance issues, do not manually clear the +buffer with the [Clear()](Velaptor.Batching.IBatcher.md#Velaptor.Batching.IBatcher.Clear() 'Velaptor.Batching.IBatcher.Clear()')() method +and set this property to true. That would be a waste of resources. + + + +### AutoSceneLoading + +Gets or sets a value indicating whether or not the scenes should be automatically loaded. + +```csharp +public bool AutoSceneLoading { get; set; } +``` + +Implements [AutoSceneLoading](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.AutoSceneLoading 'Velaptor.UI.IWindow.AutoSceneLoading') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### AutoSceneRendering + +Gets or sets a value indicating whether or not the scenes should be automatically rendered. + +```csharp +public bool AutoSceneRendering { get; set; } +``` + +Implements [AutoSceneRendering](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.AutoSceneRendering 'Velaptor.UI.IWindow.AutoSceneRendering') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### AutoSceneUnloading + +Gets or sets a value indicating whether or not the scenes should be automatically unloaded. + +```csharp +public bool AutoSceneUnloading { get; set; } +``` + +Implements [AutoSceneUnloading](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.AutoSceneUnloading 'Velaptor.UI.IWindow.AutoSceneUnloading') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### AutoSceneUpdating + +Gets or sets a value indicating whether or not the scenes should be automatically updated. + +```csharp +public bool AutoSceneUpdating { get; set; } +``` + +Implements [AutoSceneUpdating](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.AutoSceneUpdating 'Velaptor.UI.IWindow.AutoSceneUpdating') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Draw + +Gets or sets the [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate that is invoked per frame for rendering. + +```csharp +public System.Action? Draw { get; set; } +``` + +Implements [Draw](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Draw 'Velaptor.UI.IWindow.Draw') + +#### Property Value +[System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[FrameTime](Velaptor.FrameTime.md 'Velaptor.FrameTime')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') + + + +### Fps + +Gets the frames per second that the main loop is running at. + +```csharp +public float Fps { get; } +``` + +Implements [Fps](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Fps 'Velaptor.UI.IWindow.Fps') + +#### Property Value +[System.Single](https://docs.microsoft.com/en-us/dotnet/api/System.Single 'System.Single') + + + +### Height + +Gets or sets the height of the window. + +```csharp +public uint Height { get; set; } +``` + +Implements [Height](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Height 'Velaptor.UI.IWindow.Height') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### Initialize + +Gets or sets the [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate to be invoked one time to initialize the window. + +```csharp +public System.Action? Initialize { get; set; } +``` + +Implements [Initialize](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Initialize 'Velaptor.UI.IWindow.Initialize') + +#### Property Value +[System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') + + + +### Initialized + +Gets a value indicating whether or not the window has been initialized. + +```csharp +public bool Initialized { get; } +``` + +Implements [Initialized](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Initialized 'Velaptor.UI.IWindow.Initialized') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### MouseCursorVisible + +Gets or sets a value indicating whether or not the mouse cursor is visible. + +```csharp +public bool MouseCursorVisible { get; set; } +``` + +Implements [MouseCursorVisible](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.MouseCursorVisible 'Velaptor.UI.IWindow.MouseCursorVisible') + +#### Property Value +[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + + + +### Position + +Gets or sets the position of the window. + +```csharp +public System.Numerics.Vector2 Position { get; set; } +``` + +Implements [Position](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Position 'Velaptor.UI.IWindow.Position') + +#### Property Value +[System.Numerics.Vector2](https://docs.microsoft.com/en-us/dotnet/api/System.Numerics.Vector2 'System.Numerics.Vector2') + + + +### SceneManager + +Gets the scene manager. + +```csharp +public Velaptor.Scene.ISceneManager SceneManager { get; } +``` + +Implements [SceneManager](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.SceneManager 'Velaptor.UI.IWindow.SceneManager') + +#### Property Value +[ISceneManager](Velaptor.Scene.ISceneManager.md 'Velaptor.Scene.ISceneManager') + + + +### Title + +Gets or sets the title of the window. + +```csharp +public string Title { get; set; } +``` + +Implements [Title](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Title 'Velaptor.UI.IWindow.Title') + +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + + + +### TypeOfBorder + +Gets or sets the type of border that the [IWindow](Velaptor.UI.IWindow.md 'Velaptor.UI.IWindow') will have. + +```csharp +public Velaptor.WindowBorder TypeOfBorder { get; set; } +``` + +Implements [TypeOfBorder](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.TypeOfBorder 'Velaptor.UI.IWindow.TypeOfBorder') + +#### Property Value +[WindowBorder](Velaptor.WindowBorder.md 'Velaptor.WindowBorder') + + + +### Uninitialize + +Gets or sets the [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate to be invoked one time to uninitialize the window. + +```csharp +public System.Action? Uninitialize { get; set; } +``` + +Implements [Uninitialize](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Uninitialize 'Velaptor.UI.IWindow.Uninitialize') + +#### Property Value +[System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') + + + +### Update + +Gets or sets the [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate that is invoked per frame for updating. + +```csharp +public System.Action? Update { get; set; } +``` + +Implements [Update](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Update 'Velaptor.UI.IWindow.Update') + +#### Property Value +[System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[FrameTime](Velaptor.FrameTime.md 'Velaptor.FrameTime')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') + + + +### UpdateFrequency + +Gets or sets the value of how often the update and render calls are invoked in the value of hertz. + +```csharp +public int UpdateFrequency { get; set; } +``` + +Implements [UpdateFrequency](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.UpdateFrequency 'Velaptor.UI.IWindow.UpdateFrequency') + +#### Property Value +[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') + + + +### Width + +Gets or sets the width of the window. + +```csharp +public uint Width { get; set; } +``` + +Implements [Width](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Width 'Velaptor.UI.IWindow.Width') + +#### Property Value +[System.UInt32](https://docs.microsoft.com/en-us/dotnet/api/System.UInt32 'System.UInt32') + + + +### WindowState + +Gets or sets the state of the window. + +```csharp +public Velaptor.StateOfWindow WindowState { get; set; } +``` + +Implements [WindowState](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.WindowState 'Velaptor.UI.IWindow.WindowState') + +#### Property Value +[StateOfWindow](Velaptor.StateOfWindow.md 'Velaptor.StateOfWindow') + + + +### WinResize + +Gets or sets the [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') delegate that is invoked every time the window is resized. + +```csharp +public System.Action? WinResize { get; set; } +``` + +Implements [WinResize](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.WinResize 'Velaptor.UI.IWindow.WinResize') + +#### Property Value +[System.Action<](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1')[SizeU](Velaptor.SizeU.md 'Velaptor.SizeU')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Action-1 'System.Action`1') +## Methods + + + +### Close() + +Closes the window. + +```csharp +public void Close(); +``` + +Implements [Close()](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Close() 'Velaptor.UI.IWindow.Close()') + + + +### Dispose() + + + +```csharp +public void Dispose(); +``` + +Implements [Dispose()](https://docs.microsoft.com/en-us/dotnet/api/System.IDisposable.Dispose 'System.IDisposable.Dispose') + + + +### Show() + +Shows the window. + +```csharp +public void Show(); +``` + +Implements [Show()](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.Show() 'Velaptor.UI.IWindow.Show()') + + + +### ShowAsync(Action, Action) + +Shows the window asynchronously. + +```csharp +public System.Threading.Tasks.Task ShowAsync(System.Action? afterStart=null, System.Action? afterUnload=null); +``` +#### Parameters + + + +`afterStart` [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') + +Executed after the application starts asynchronously. + + + +`afterUnload` [System.Action](https://docs.microsoft.com/en-us/dotnet/api/System.Action 'System.Action') + +Executed after the window has been unloaded. + +Implements [ShowAsync(Action, Action)](Velaptor.UI.IWindow.md#Velaptor.UI.IWindow.ShowAsync(System.Action,System.Action) 'Velaptor.UI.IWindow.ShowAsync(System.Action, System.Action)') + +#### Returns +[System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task') +A [System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task') representing the result of the asynchronous operation. + +#### Remarks +This runs the window on another thread. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.md new file mode 100644 index 00000000..27b2f1a1 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.UI.md @@ -0,0 +1,25 @@ +--- +title: Velaptor.UI +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor.UI Namespace + +| Classes | | +| :--- | :--- | +| [Button](Velaptor.UI.Button.md 'Velaptor.UI.Button') | A button that can be clicked to execute functionality. | +| [ControlBase](Velaptor.UI.ControlBase.md 'Velaptor.UI.ControlBase') | Represents a basic control with behavior that is shared among all controls. | +| [Label](Velaptor.UI.Label.md 'Velaptor.UI.Label') | A label that renders text on the screen. | +| [TextBox](Velaptor.UI.TextBox.md 'Velaptor.UI.TextBox') | Provides the ability to enter text into a box. | +| [Window](Velaptor.UI.Window.md 'Velaptor.UI.Window') | A system window where graphics can be rendered. | + +| Structs | | +| :--- | :--- | +| [MouseMoveEventArgs](Velaptor.UI.MouseMoveEventArgs.md 'Velaptor.UI.MouseMoveEventArgs') | Holds information about the mouse position over a control. | + +| Interfaces | | +| :--- | :--- | +| [IControl](Velaptor.UI.IControl.md 'Velaptor.UI.IControl') | A user interface object that can be updated and rendered to the screen. | +| [ISizable](Velaptor.UI.ISizable.md 'Velaptor.UI.ISizable') | Represents the size of an object by its width and height. | +| [IWindow](Velaptor.UI.IWindow.md 'Velaptor.UI.IWindow') | Provides the core of an application window which facilitates how the<br/>window behaves, its state and the ability to be used in various types<br/>of applications. | diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.WindowBorder.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.WindowBorder.md new file mode 100644 index 00000000..13b87178 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.WindowBorder.md @@ -0,0 +1,36 @@ +--- +title: Velaptor.WindowBorder +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') +### [Velaptor](Velaptor.md 'Velaptor') + +## WindowBorder Enum + +The different kinds of borders that a [IWindow](Velaptor.UI.IWindow.md 'Velaptor.UI.IWindow') can have. + +```csharp +public enum WindowBorder +``` +#### Fields + + + +`Fixed` 1 + +The window has a fixed border. A window with a fixed border can only be resized +programmatically. + + + +`Hidden` 2 + +The window does not have a border. A window with a hidden border can only be +resized programmatically. + + + +`Resizable` 0 + +The window has a resizable border. A window with a resizable border can be resized +by the user or programmatically. \ No newline at end of file diff --git a/versioned_docs/version-1.0.0-preview.30/api/Velaptor.md b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.md new file mode 100644 index 00000000..c9a56b74 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/api/Velaptor.md @@ -0,0 +1,30 @@ +--- +title: Velaptor +--- + +#### [Velaptor](Namespaces.md 'Velaptor Namespaces') + +## Velaptor Namespace + +| Classes | | +| :--- | :--- | +| [App](Velaptor.App.md 'Velaptor.App') | Represents a Velaptor application. | +| [AppStats](Velaptor.AppStats.md 'Velaptor.AppStats') | Records and retrieves information about the running application. | +| [GameHelpers](Velaptor.GameHelpers.md 'Velaptor.GameHelpers') | Provides extension helper methods for common game related operations. | +| [Platform](Velaptor.Platform.md 'Velaptor.Platform') | Represents the current platform. | + +| Structs | | +| :--- | :--- | +| [FrameTime](Velaptor.FrameTime.md 'Velaptor.FrameTime') | Holds timing information for a loop iteration. | +| [SizeU](Velaptor.SizeU.md 'Velaptor.SizeU') | Stores an ordered pair of [unsigned](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/unsigned 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/unsigned') integers, which specify a [Width](Velaptor.SizeU.md#Velaptor.SizeU.Width 'Velaptor.SizeU.Width') and [Height](Velaptor.SizeU.md#Velaptor.SizeU.Height 'Velaptor.SizeU.Height'). | + +| Interfaces | | +| :--- | :--- | +| [IDrawable](Velaptor.IDrawable.md 'Velaptor.IDrawable') | Provides the ability for an object to be rendered. | +| [IPlatform](Velaptor.IPlatform.md 'Velaptor.IPlatform') | Represents the current platform. | +| [IUpdatable](Velaptor.IUpdatable.md 'Velaptor.IUpdatable') | Provides the ability for an object to be updated. | + +| Enums | | +| :--- | :--- | +| [StateOfWindow](Velaptor.StateOfWindow.md 'Velaptor.StateOfWindow') | The different states that a [Window](Velaptor.UI.Window.md 'Velaptor.UI.Window') can be in. | +| [WindowBorder](Velaptor.WindowBorder.md 'Velaptor.WindowBorder') | The different kinds of borders that a [IWindow](Velaptor.UI.IWindow.md 'Velaptor.UI.IWindow') can have. | diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/_category_.json b/versioned_docs/version-1.0.0-preview.30/guides/guides/_category_.json new file mode 100644 index 00000000..c1c76299 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "Guides", + "position": 2, + "link": { + "type": "generated-index", + "description": "Tutorials on how to use Velaptor to create games." + } +} diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/adding-content.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/adding-content.mdx new file mode 100644 index 00000000..c4bc069e --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/adding-content.mdx @@ -0,0 +1,79 @@ +--- +sidebar_position: 2 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { TutorialLink } from "@site/src/components/TutorialLink"; + +# Adding Content + +Content is the lifeblood of a game; without it, there is no game. In this section, we will +learn how to add content to our game. + +Various types of content can be added to a game. In this tutorial, we will be adding an image to our game which will be loaded and consumed by Velaptor and converted into a `Texture` object. Other content such as fonts and sounds can also be added. You can even build custom content loaders to load other types of content for your game. +The types of content supported by Velaptor are: +- PNG images +- OGG audio files +- MP3 audio files +- Atlas texture metadata files (these are in JSON format) +- Fonts (TTF files) + +Below are the steps to add content to your game. The steps are the same, no matter what kind of content you are adding; +the only difference is the folder location. + +:::note Future Plans +There are plans in the future to improve how content is managed as well as support more file formats. +The process laid out below is a process specific to Visual Studio and JetBrains Rider. +::: + + +## Step 1: Create Project + +Create a basic Velaptor application. +:::note Refer To Guide +For more info, refer to the [Project Setup](./project-setup) guide. +::: + + +## Step 2: Create content folder + +Create a content folder based on the type of content being added. + + +In the solution explorer, add a folder named _**Content**_ to the root of the project, then add a folder named _**Graphics**_ to the _**Content**_ folder. +Once this is complete, download the Velaptor mascot image and put it into the _**./Content/Graphics**_ folder. + + + + Example banner + + + Example banner + + + +:::info IMPORTANT +In the same location as the running application, the _**Content/Graphics**_ folder is _**required**_ for Velaptor's default content location for graphics file content. +::: + + +## Step 3: Set as content + +Now that the image file is added to the project, we can tell our IDE to copy the file and its directory +structure to the build output location of where the application lives. This will update the +appropriate content directory every time the project is built. Every time you add another content +item to the project, you will need to follow this same process. + +:::note Note about IDEs +These copy file features are part of [Visual Studio](https://visualstudio.microsoft.com/) and [JetBrains Rider](https://www.jetbrains.com/rider/), not of Velaptor. +::: + + + + Example banner + + + Example banner + + diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/_category_.json b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/_category_.json new file mode 100644 index 00000000..41457190 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "Tutorials coming soon!!", + "position": 9, + "link": { + "type": "generated-index", + "description": "New guides that are on their way. ๐Ÿ˜€" + } +} diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/rendering-lines.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/rendering-lines.mdx new file mode 100644 index 00000000..d1199a71 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/rendering-lines.mdx @@ -0,0 +1,10 @@ +--- +sidebar_position: 3 +--- + +# Rendering Lines + +Documentation coming soon!! +:::note +This feature currently exists and is explained in the API documentation. +::: diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/rendering-rects.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/rendering-rects.mdx new file mode 100644 index 00000000..54138979 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/rendering-rects.mdx @@ -0,0 +1,10 @@ +--- +sidebar_position: 2 +--- + +# Rendering Rectangles + +Documentation coming soon!! +:::note +This feature currently exists and is explained in the API documentation. +::: diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/scenes.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/scenes.mdx new file mode 100644 index 00000000..dde11a05 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/scenes.mdx @@ -0,0 +1,10 @@ +--- +sidebar_position: 7 +--- + +# Scenes + +Documentation coming soon!! +:::note +This feature currently exists and is explained in the API documentation. +::: diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/system-monitors.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/system-monitors.mdx new file mode 100644 index 00000000..0a817330 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/system-monitors.mdx @@ -0,0 +1,10 @@ +--- +sidebar_position: 9 +--- + +# System Monitors + +Documentation coming soon!! +:::note +This feature currently exists and is explained in the API documentation. +::: diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/windows.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/windows.mdx new file mode 100644 index 00000000..1afebfc8 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/coming-soon/windows.mdx @@ -0,0 +1,10 @@ +--- +sidebar_position: 8 +--- + +# Windows + +Documentation coming soon!! +:::note +This feature currently exists and is explained in the API documentation. +::: diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/keyboard-input.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/keyboard-input.mdx new file mode 100644 index 00000000..744ba3a1 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/keyboard-input.mdx @@ -0,0 +1,259 @@ +--- +sidebar_position: 6 +--- + +import { TutorialLink } from "@site/src/components/TutorialLink"; + +# Keyboard Input + +The wonder of interactivity lies in being able to control your game with a keyboard or other types of hardware input. +Without the ability to control your game, you are just staring at a looping animation. The "interface" between +the human playing the game and the game responding to the human is the hardware such as a keyboard or mouse. + +Hardware for interacting with games can come in many forms. The most common types of input hardware are a keyboard, +mouse, or game controller. The type of hardware you use to interact with a game though depends on the type of +game and user preferences. + +In addition, this guide will show you how to use the keyboard to control your game. The options for how to respond +to keyboard input are endless. Examples of what you can do with the keyboard are character movement, pausing the game, +and exiting the game when necessary. + +:::note Guide Source Code +Go to the tutorial project to see the source code for a fully working example of this guide. +::: + + +## Step 1: Project setup + +This tutorial will demonstrate how to use keyboard input to move and resize the game window in a Velaptor application. +While this may seem simple, it is a crucial skill for any game developer to master. + +To get started, create a new Velaptor application. +:::note Refer To Guide +For more info, refer to the [Project Setup](./project-setup) guide. +::: + +The only game loop method required for this tutorial will be the `OnUpdate()` method, which we +will be used to update the game state and resize and move the window respectively. + + +## Step 2: Creating game state + +We need to create some class fields to hold onto the state of the game. Let's do this now. + +### Step 2.1: Creating the class fields + + +Create some class fields that will be useful for things such as getting keyboard state, saving keyboard state, +and some variables for holding information for moving the window. + +```csharp +public class Game : Window +{ + private const float VelocityXAndY = 300f; + private readonly IAppInput keyboard; + private KeyboardState currKeyState; + private KeyboardState prevKeyState; + private Vector2 velocity = Vector2.Zero; +} +``` + +### Step 2.2: Creating a keyboard object + +To enable keyboard input in your Velaptor game, you'll need to create a new instance of `IAppInput`, +which will be set to the class field `keyboard`. This will provide access to the current state of the keyboard. +You can create a new keyboard object quickly and easily using Velaptor's `HardwareFactory` class. + +```csharp +public Game() => this.keyboard = HardwareFactory.GetKeyboard(); +``` + +:::info What is this _**Factory**_ thing? +The Factory pattern is a creational design pattern that provides an interface for creating objects. +Click [here](https://refactoring.guru/design-patterns/factory-method) for a great site about creational patterns. +::: + + +## Step 3: Creating helpful methods + +We don't _**NEED**_ these methods that we are about to create. However, they will make our code more readable and +easier to understand. This is good practice no matter what kind of software you are writing. + +### Step 3.1: Key pressed detection + +Create a private method in the `Game` class with the name `IsPressed()` which will check if a keyboard key has been pressed. + +```csharp +private bool IsPressed(KeyCode key) => this.currKeyState.IsKeyUp(key) && + this.prevKeyState.IsKeyDown(key); +``` + +This method will check if the _**current**_ state of the key is in the up position, and if the state of the same key was in the down +position in the _**previous**_ frame. If this is the case, then the key was pressed down and then released which means +the key was pressed. + +This will make more sense when we create our `Update()` method logic. + +### Step 3.2: Moving the window + +When we press the arrow keys on the keyboard, we want to move the window around. To do this, create the `MoveWindow()` +below with the following code. + +```csharp +private void MoveWindow(FrameTime frameTime) +{ + if (this.currKeyState.IsKeyDown(KeyCode.Right)) + { + this.velocity.X = VelocityXAndY; + } + + if (this.currKeyState.IsKeyDown(KeyCode.Left)) + { + this.velocity.X = -VelocityXAndY; // Negate the velocity to move left + } + + if (this.currKeyState.IsKeyDown(KeyCode.Up)) + { + this.velocity.Y = -VelocityXAndY; // Negate the velocity to move up + } + + if (this.currKeyState.IsKeyDown(KeyCode.Down)) + { + this.velocity.Y = VelocityXAndY; + } + + var displacement = this.velocity * (float)frameTime.ElapsedTime.TotalSeconds; + + Position += displacement; +} +``` + +This method will check if an arrow key is in the down position. If it is, it will then set the velocity of the `velocity` +field component to a value that will move the window in the direction described by the arrow key. +This will be called later in our `OnUpdate()` method. + +:::info How are time, velocity, and displacement related? +
Expand me for more info!! +In our code, we're multiplying the velocity of the window's movement by the elapsed time since the last frame. This ensures +that the window moves at a consistent speed, regardless of the frame rate. Because the CPU is responsible for executing the +game logic and rendering each frame, a faster CPU can complete more operations in the same amount of time, resulting in +a higher frame rate. + +To ensure that players have a consistent experience, game objects must move at the same speed on all computers, +regardless of the CPU speed. This means that game developers must account for differences in hardware and optimize +their code to achieve consistent results. +
+::: + +### Step 3.3: Changing the window size + +The window size will be changed when we press the arrow keys. Create the `ChangeWinSize()` method with the code below +to change the size of the window using the keyboard. + +```csharp +private void ChangeWinSize() +{ + if (IsPressed(KeyCode.Right)) + { + Width += 50; // Increase the width of the window + } + + if (IsPressed(KeyCode.Left)) + { + Width -= 50; // Decrease the width of the window + } + + if (IsPressed(KeyCode.Up)) + { + Height -= 50; // Decrease the height of the window + } + + if (IsPressed(KeyCode.Down)) + { + Height += 50; // Increase the height of the window + } +} +``` + +This method checks if the arrow keys have been pressed fully down and then released. If they have, then the size of +the window will be changed. This will also be called later in our `OnUpdate()` method. + + +## Step 4: Finish up + +We can now finish up the rest by tracking the state of the keyboard and using some simple logic to move or resize +the window based on the state of the keyboard keys. + +### Step 4.1: Getting the keyboard state + +To check the state of keyboard keys in your game, you need to retrieve the keyboard state for each frame of +the game loop. This will allow you to analyze which keys are currently in the up or down position. With this +information, you can make decisions about what actions to take based on the state of a single key or a combination of keys. + +First, set the _**current**_ and _**previous**_ state of the keyboard. + +```csharp +protected override void OnUpdate(FrameTime frameTime) +{ + this.currKeyState = this.keyboard.GetState(); + this.prevKeyState = this.currKeyState; +} +``` + +To accurately detect keyboard input, we need to get and save both the _**current**_ and _**previous**_ states. This helps us +track changes in key states, such as when a key is pressed down and then released, which is necessary for +accurate detection of a _**full**_ key press. + +### Step 4.2: Putting it all together + +In between the _**current**_ and _**previous**_ keyboard state lines of code, add the logic to the `OnUpdate()` method below: + +```csharp +protected override void OnUpdate(FrameTime frameTime) +{ + ... + // If the left or right control key is pressed, move the window. + if (this.currKeyState.AnyCtrlKeysDown()) + { + MoveWindow(frameTime); + } + else + { + // Change the window size. + ChangeWinSize(); + } + + this.velocity = Vector2.Zero; + ... +} +``` + +The `OnUpdate()` method will first check if the _**current**_ state of any _**Ctrl**_ keys is being pressed in the down position. +If this is the case, then the window will be moved. If not, then the window size will be changed. + +### Step 4.3: Run it + +Run the application and then begin by pressing the arrow keys to observe the window's width and height increase +or decrease. The window will only resize when you release the arrow key from the down position. + +Next, hold down any Ctrl key and then use the arrow keys to move the window around the screen. You'll notice that you can keep +the window moving without releasing the arrow keys, as we're not looking for a full key press. + +Now you have all that you need to get input from the user via the keyboard!! + +## Step 5: Bonus + +It would be nice to see the current size and position of the window. To do this, we can override the `OnResize()` method +and update the window's title with the new size and position. + +Add the method below in the `Game` class. + +```csharp +protected override void OnResize(SizeU size) +{ + Title = $"Window Size: W: {Width} H: {Height} | Window Position: X: {Position.X} Y: {Position.Y}"; + base.OnResize(size); +} +``` + +Run the application and now you can see the size and position of the window in the title bar. diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/mouse-input.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/mouse-input.mdx new file mode 100644 index 00000000..5d5c6083 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/mouse-input.mdx @@ -0,0 +1,186 @@ +--- +sidebar_position: 7 +--- + +import { TutorialLink } from "@site/src/components/TutorialLink"; + +# Mouse Input + +:::note Guide Source Code +Go to the tutorial project to see the source code for a fully working example of this guide. +::: + +As explained in the [Keyboard Input](./keyboard-input) tutorial, being able to interact with a game is very important. + +In this tutorial, you will learn how to get the state of the mouse so you can make decisions on that state. This will open +the doors giving your game the control that it needs outside of using a keyboard. + + +## Step 1: Project setup + +Set up an empty Velaptor project. + +:::note Refer To Guide +For more info, refer to the [Project Setup](./project-setup) guide. +::: + +The only game loop method required for this tutorial will be the `OnUpdate()` method, which we +will be used to update the game state and resize the window. + +The rest of the game loop methods described in the _**project setup guide**_ can be removed. + +## Step 2: Creating game state + +Let's create some class fields to help us control the window size. + +### Step 2.1: Creating the class fields + +Create some class fields that can hold the state of the mouse and the amount that will be applied to the height of the +window. + +```csharp +public class Game : Window +{ + private const int HeightChangeAmount = 50; + private readonly IAppInput mouse; + private MouseState prevMouseState; +} +``` + +### Step 2.2: Creating a mouse object + +To enable mouse input in your Velaptor game, you'll need to create a new instance of `IAppInput`, +which will be set to the class field `mouse`. This will provide access to the current state of the mouse. +You can create a new mouse object quickly and easily using Velaptor's `HardwareFactory` class. + +Use the factory to create the mouse object in the `Game` constructor. + +```csharp +public Game() => this.mouse = HardwareFactory.GetMouse(); +``` + + +## Step 3: Changing the window size + +Perform the following steps to change the size of the window by using the mouse. + +### Step 3.1: Getting the mouse state + +We can get the state of the mouse by using the `mouse` object that we saved to the class field. In the `OnUpdate()` method, +use the `mouse` object to get the current state of the mouse. Also, save the current mouse state as the previous mouse state. +This way, when the next frame is executed, we can compare the current mouse state to the previous mouse state to see +if there are differences between the two states to detect if a button has been pressed or the mouse has moved. + +```csharp +protected override void OnUpdate(FrameTime frameTime) +{ + var currMouseState = this.mouse.GetState(); + + this.prevMouseState = currMouseState; + + base.OnUpdate(frameTime); +} +``` + +### Step 3.2: Changing the window width + +Next, between the two mouse states in the `OnUpdate()` method, change the width of the window by adding the code below: + +```csharp +private void OnUpdate(FrameTime frameTime) +{ + ... + + // If the left mouse button is currently being held in the down position + if (currMouseState.GetButtonState(MouseButton.LeftButton)) + { + // The position of the mouse for the current frame + var currMousePos = currMouseState.GetPosition(); + + // The position of the mouse in the previous frame + var prevMousePos = this.prevMouseState.GetPosition(); + + // Add the mouse movement amount to the current width of the window + Width += (uint)(currMousePos.X - prevMousePos.X); + } + + this.prevMouseState = currMouseState; + + base.OnUpdate(frameTime); +} +``` + +This code checks whether or not the left mouse button is currently being held down. If it is, then the width of the +window will change based on the difference between the current and previous mouse positions. As you move the mouse +left and right, it will take the difference between the position on the X-axis and apply that to the width of the window. + +The important part here is the `this.prevMouseState = currMouseState`. As long as the logic is added between the current +and previous mouse states, there is something to compare to know if the mouse has moved. + +### Step 3.3: Changing the window height + +Now we can add the code to change the height of the window as we scroll the mouse wheel. +Below the `if` block we added in the previous step, add the following code: + +```csharp +private void OnUpdate(FrameTime frameTime) +{ + ... + + // Get the current value of the mouse scroll wheel + var wheelValue = currMouseState.GetScrollWheelValue(); + + // If the mouse wheel was not scrolled, exit the method + if (wheelValue != 0) + { + // Check if the mouse wheel was scrolled down or up. + // If the value is negative, the mouse wheel has been scrolled in the down direction. + var scrolledDown = wheelValue < 0; + + // Change the height of the window based on the direction the mouse wheel was scrolled. + Height = scrolledDown + ? Height - HeightChangeAmount + : Height + HeightChangeAmount; + } + + this.prevMouseState = currMouseState; + + base.OnUpdate(frameTime); +} +``` + +This code gets the current value of the mouse wheel and uses it to detect which direction the mouse wheel was scrolled. +When the mouse wheel is scrolled toward you like you are scrolling down a web page, it returns a negative value and when +it is scrolled up away from you like scrolling back to the top of a web page, it returns a positive value. + +If the mouse wheel has not been scrolled at all for the current frame, it will be 0. Only change the height if the mouse +has been scrolled. + +If the mouse was scrolled in either direction, increase or decrease the height of the window. +That's it!! Now we are controlling the width and height of the window using the mouse!! +This of course can be used for _**ANYTHING**_. Character movement, aiming a weapon, and game menu item selection +some examples of what the mouse can be used for in a game. + + +### Step 3.4: Run it + +Run the application and you should be able to change the width and height of the window using the mouse. +To change the width of the window, hold down the left mouse button and move the mouse from left to right. +To change the height of the window, scroll the mouse wheel up or down. + +## Step 4: Bonus + +It would be nice to see the current size of the window, right? To do that, we can override the `OnResize()` method +and update the window's title with the new size. + +In the `Game` class, add the method shown below: + +```csharp +protected override void OnResize(SizeU size) +{ + Title = $"Window Size: W: {Width} H: {Height}"; + base.OnResize(size); +} +``` + +Run the application and now you can see the size of the window in the title bar. diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/project-setup.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/project-setup.mdx new file mode 100644 index 00000000..2d42da26 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/project-setup.mdx @@ -0,0 +1,177 @@ +--- +sidebar_position: 1 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { TutorialLink } from "@site/src/components/TutorialLink"; + +# Project Setup + +This guide will show you the basics of creating a simple, empty Velaptor application. + +:::note Guide Source Code +Go to the tutorial project to see the source code for a fully working example of this guide. +::: + +:::note Guide Source Code +There are plans in the future to create a project template for [Visual Studio](https://visualstudio.microsoft.com/) and +[JetBrains Rider](https://www.jetbrains.com/rider/) users to easily create a basic Velaptor application. +::: + +First things first. You have to create a project with your preferred IDE!! + +## Step 1: Create the application + +Create a new C# console application using dotnet _**v7.0**_ + + +## Step 2: Add Velaptor to the project + +Add the Velaptor [NuGet package](https://www.nuget.org/packages/KinsonDigital.Velaptor) to the project. + - Make sure to click the preview check box in your IDE of choice. Since Velaptor is currently in preview, clicking the checkbox will allow you to see the NuGet package. + + + Example banner + + + Example banner + + + + +## Step 3: Create main classes + +The game class is the class used to contain all of the game loop/lifecycle methods. These are the update and render methods, +the load and unload content methods and more. + +### Step 3.1: Create game class + +Create a new class file named `Game`. This will be necessary to take advantage of the game-related methods of Velaptor. These methods +are used for things such as loading and unloading content, updating your game objects, and rendering graphics to the screen. + +```csharp +namespace HelloVelaptor; + +public class Game : Window +{ +} +``` + +:::tip Top Level Statements +Top-level statements are a newer feature added in C#10 that enables you to avoid the extra ceremony of creating the `main` entry point method +in a class. +Click [here](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/top-level-statements) to learn more!! +::: + + +### Step 3.2: Create app entry point + +All applications need some kind of entry point. This is the starting point of your application. In the case of Velaptor as well as +all C# applications, the entry point is the `main` method in the `Program` class. Let's take advantage of the latest C# +features and use top-level statements. Create a new `Program.cs` file and add the following code: + +```csharp +var game = new EmptyProject.Game(); +game.Show(); +``` + +## Step 4: Creating game methods + +When developing games, you need to take advantage of various methods that are _**hooked**_ into +various parts of the game lifecycle. These lifecycle events are things such as content loading, +content unloading, updating, drawing, etc. + +Here is a diagram that shows the lifecycle of a Velaptor game. + +```mermaid +flowchart LR + subgraph id5 ["Game Window"] + + id1("Load Content - OnLoad()") -.Called Once.-> id2("Update Game - OnUpdate()") + id2 ==Game==> id3("Draw Game - OnDraw()") + id3 ==Loop==> id2 + id3 -.Window/Game Shutdown.-> id4("Unload Content - OnUnload()") + end + + id5 --Size Changed--> id6("OnResize()") + + style id1 stroke:#8ac194 + linkStyle 1 stroke:#81B1DB,stroke-width:3px,stroke-dasharray: 4 + linkStyle 2 stroke:#81B1DB,stroke-width:3px,stroke-dasharray: 4 + style id4 stroke:#c5635c +``` + +### Step 4.1: Create `OnLoad()` method +Once the game class file has been created, we need a way to load content. We can load sounds, textures, fonts, atlas textures and atlas data, or any +kind of content your game needs. This method will be invoked once time as the application loads up. + +Create a method override of the `Window.Load()` method in the `Game` class as shown below: + +```csharp +protected override void OnLoad() +{ + base.OnLoad(); +} +``` + +### Step 4.2: Create `OnUpdate()` method + +The next method to create is the `OnUpdate()` method. This method will be invoked once every frame and always before the `OnDraw()` method is +invoked. This is where you should add your game logic and update your game state. The point of +this method is to add _**behavior**_ to your game. Think of it as the brains of your game. + +```csharp +protected override void OnUpdate(FrameTime frameTime) +{ + base.OnUpdate(frameTime); +} +``` + +### Step 4.3: Create `OnDraw()` method + +Now that we have a way to update our game state, we need to create a method to render our game to the screen. Create a method override of the `Window.OnDraw()` method. +The `OnDraw()` method is invoked once every frame and always after the `OnUpdate()` method is invoked. +The point of this method is only for rendering your game to the screen. + +```csharp +protected override void OnDraw(FrameTime frameTime) +{ + base.OnDraw(frameTime); +} +``` + +### Step 4.4: Create `OnResize()` method + +If you want to have your game react when the window size changes, you can create a method override of the `Window.OnResize()` method. +The `OnResize()` method is invoked anytime the window's size is changed. This includes minimizing, maximizing, and restoring the window. +This is a great location to run game logic that can do anything you need. One good example is to pause your game automatically +when minimized and to unpause when the window is maximized or restored. + +```csharp +protected override void OnResize(SizeU size) +{ + base.OnResize(size); +} +``` + +### Step 4.5: Create `OnUnload()` method + +We need a way to unload our content. This can be performed by creating a method override of the `Window.OnUnload()` method. +The `OnUnload()` method is invoked one time when the window is closed. This is to free resources and content from your game on +the CPU side as well as loaded textures from the GPU. This is also where scene management unloading can be performed. + +```csharp +protected override void OnUnload() +{ + base.OnUnload(); +} +``` + +## Step 5: Run it + +Run the application!! + +Example banner + +I know it isn't much, but we will get there. ๐Ÿ’ช๐Ÿป diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-atlas-textures.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-atlas-textures.mdx new file mode 100644 index 00000000..bd3cd162 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-atlas-textures.mdx @@ -0,0 +1,492 @@ +--- +sidebar_position: 5 +--- + +import { TutorialLink } from "@site/src/components/TutorialLink"; + +# Rendering With An Atlas Texture + +:::note Guide Source Code +Go to the tutorial project to see the source code for a fully working example of this guide. +::: + +Another way to render textures is by using an atlas texture. This guide is a little more +in-depth and longer than the previous guides. Stick with it though, it will be worth it!! + +:::info Atlas Texture? +Want more detail about what an atlas texture is? Refer to the links below: +1. [Wikipedia](https://en.wikipedia.org/wiki/Texture_atlas) +2. [Game Dev Tuts Plus](https://gamedevelopment.tutsplus.com/articles/using-texture-atlas-in-order-to-optimize-your-game--cms-26783) +3. [Examples](https://www.pinterest.com/pin/676877018967605282/) +::: + +An atlas texture is a large image with multiple sub-images packed into a single image. With this single image, you use another file +of a particular format such as JSON or XML, that describes the location, size, and other kinds of metadata for each image in the atlas texture. + +:::info JSON +If you are new to **JSON**, click [here](https://www.youtube.com/watch?v=iiADhChRriM) for a great 10-minute video. +::: + +When [rendering textures](./rendering-textures) the standard way, you render the entire texture. +Though there is nothing wrong with rendering whole textures one at a time, there are pros and cons. In the end, it all depends on what you are trying to accomplish. + +With an atlas texture, you can pack all of the sequences of animation into the atlas. This is usually loaded by a library that loads the atlas texture +and the associated metadata. At this point, it is very easy to automate the process of switching between textures to run an animation. Velaptor comes with loading +atlas textures and their associated metadata built in. + +**Benefits:** + +- **Reduces draw calls:** Reduces the number of times Velaptor needs to send data to the GPU and reduces the number of draw calls. Instead of sending data and making draw calls for each texture, you only have to for a single atlas texture. +- **Improved performance:** Reduces draw calls to improve the performance of your game. +- **Easier management:** Easier to manage one large texture than many small ones, especially when it comes to loading and unloading textures and coordinating the draw calls between textures. This result is less code. +- **Smoother Animations:** Makes animations smoother by reducing the amount of time your game spends loading and unloading textures. +- **Reduced memory usage:** Reduces the amount of memory your games use since you only need to load one large texture instead of many smaller ones. + +It all depends on your goals. A lot of games use a combination of whole texture and atlas texture rendering. + +Various tools out there give you the ability to easily create atlas textures and metadata. +A couple of examples are: [Texture Packer](https://www.codeandweb.com/texturepacker) +and [Spine](https://esotericsoftware.com/). + +:::note Loading Metadata +Velaptor does not currently have a tool to build these atlas texture images with the associated metadata. +Plans are in the works to add _**Texture Packer**_ integration. One option you have is to create a tool to +load the _**Texture Packer**_ JSON data for use. +::: + +:::tip +Do not overstress about whole vs. atlas texture rendering. This comes with practice and depends on your needs. +Keep your needs into account as you develop your game and do not worry about performance until it starts to become an issue. +::: + +:::info Atlas Texture Scenario +
Expand me for more info!! + +Let's consider a 2D space shooter game with lots of bullets and enemies. In this type of game, there may be a large +number of sprites for the player, the enemies, and the projectiles. +Loading and rendering all of these individually can quickly lead to performance issues due to the large number +of draw calls required. + +By using atlas textures, you can pack all of these sprites into a single texture, which can be loaded and rendered +more efficiently. For example, an atlas texture can contain all of the different enemy sprites, +along with their animations and various attack patterns. Similarly, you can create another atlas texture that contains +all of the different bullet sprites, including the various types of projectiles and their associated effects. + +By doing this, the game engine can render multiple sprites in a single draw call, significantly improving performance. +Additionally, since all of the sprites are contained within a single atlas texture, there's no need to switch textures +between draw calls, which reduces overhead and leads to smoother gameplay. + +Another benefit of using atlas textures is that it can reduce the overall size of the game's asset files. +This is because all of the sprites are packed into a single texture, reducing the amount of duplicated +metadata and overhead that would be required for individual files. + +Overall, using atlas textures in a game can improve performance, reduce file size, and lead to smoother gameplay. +
+::: + +Enough explanation!! Let's get our hands dirty and build something!! + +For this tutorial, we are going to build a simple game that will show a blue animating flame. +This flame will be rendered in the center of the window and will animate in a loop indefinitely. +We will also add a very small amount of randomness to it as well to enhance the animation. + + +## Step 1: Create Project + +Create a basic Velaptor application. +:::note Refer To Guide +For more info, refer to the [Project Setup](./project-setup) guide. +::: + + +## Step 2: Get atlas content + +Download the atlas texture files below: +- Go here to download the atlas.png file. +- Go here to download the atlas.json file. + +Click the GitHub download button shown below to download the file + + + +## Step 3: Add content to project + +Add the downloaded atlas texture and metadata JSON file to the _**Content/Atlas/**_ directory in the project. +:::note Refer To Guide +For more info, refer to the [Adding Content](./adding-content) guide. +::: + +Both files should be in the same directory and besides the extension, should have the same name. +The two files you downloaded should be named _**atlas.png**_ and _**atlas.json**_. + +:::note FILE NAME REQUIREMENTS +You can name the files whatever you want, but the file names, excluding the extensions, must match. +When you load an atlas texture, you will specify the name of the atlas image and metadata and both +files will be loaded at the same time. +::: + +:::caution Warning +If you have an image file with no metadata file or vice versa, Velaptor will throw an exception +letting you know that _**one**_, the _**other**_, or _**both**_ are missing. +::: + +## Step 4: Create class fields + +Create the following class fields which will be used for holding content data, loading content, and rendering content. + +```csharp +public class Game : Window +{ + private readonly ITextureRenderer textureRenderer; // Renders textures + private readonly IBatcher batcher; // Batches the rendering of textures + private ILoader? atlasLoader; // Loads the atlas data + private AtlasSubTextureData[]? subTextureData; // Holds all of the atlas data + private ITexture? atlasTexture; // The atlas texture +} +``` + +## Step 5: Basic setup + +In the `Game` class, add the following code to the constructor to set up the window, create a texture renderer, and the batcher. + +```csharp +public class Game : Window +{ + ... + public Game() + { + Title = "Atlas Textures"; + Width = 530; + Height = 530; + + var rendererFactory = new RendererFactory(); + this.textureRenderer = rendererFactory.CreateTextureRenderer(); + + this.batcher = rendererFactory.CreateBatcher(); + } +} +``` + + +## Step 6: Load and unload the content + +### Step 6.1: Load texture atlas content + +Next, let's create the `OnLoad()` override method and add code to the method to create an atlas +loader and load the atlas data. + +```csharp +protected override void OnLoad() +{ + this.atlasLoader = ContentLoaderFactory.CreateAtlasLoader(this.batcher); + + // Loads the atlas.png and atlas.json file + var atlasData = ContentLoader.LoadAtlas("atlas"); + + this.atlasTexture = atlasData.Texture; + this.subTextureData = atlasData.GetFrames("flame"); + + base.OnLoad(); +} +``` + +The `atlasData` variable will contain the loaded texture and the metadata for the texture. +We can use this data to make decisions on animation, positioning and more. + +:::tip +All you have to provide is the _**name**_ of the atlas. Though you can use the file extension, +it is not required and there is no need to load the _**.png**_ and _**.json**_ files separately +::: + +:::info metadata format + +
Expand me for more info!! + +Let's go over the JSON data that is contained in the metadata file. + +_**$type**_: This is the type of object that is used by the JSON serializer to know what type of object to create. +There is no need to worry about this key. Do not change it and you will be fine. + +_**Bounds**_: This is the x, y, width, and height of the sub-texture in the atlas. This is used to determine where +the sub-texture is located in the atlas. These are what you will use during the rendering process to render the frame of the animation. + +_**FrameIndex**_: This is the frame number of an animation. If the frame number is -1, then this is not part of an +animation. This is what you will use to keep track of which frame of animation you want to render. + +_**Name**_: This is the name of the sub-texture and is what you will use in determining which group of frames animation +you want to load and when calling the `GetFrames()` method. If you wanted to load the metadata for the _**ship**_ +sub-texture, you would call `GetFrames("ship")` and you would only get an array with a single item. + +```json +{ + "$type": "Velaptor.Graphics.AtlasSubTextureData, Velaptor", + "Bounds": "1, 846, 403, 948", // The x, y, width, and height of the sub-texture in the atlas + "FrameIndex": 8, // The frame number of an animation + "Name": "flame" // The name of the sub-texture +}, +{ + "$type": "Velaptor.Graphics.AtlasSubTextureData, Velaptor", + "Bounds": "428, 850, 361, 948", + "FrameIndex": 9, + "Name": "flame" +}, +{ + "$type": "Velaptor.Graphics.AtlasSubTextureData, Velaptor", + "Bounds": "0, 76, 75, 75", + "FrameIndex": -1, // -1 means that this is not part of an animation + "Name": "ship" +} +``` +
+::: + +### Step 6.2: Unload content + +Now we can unload the content when the game shuts down. This is to clean up resources that are no longer needed. +To do this, we can override the `OnUnload()` method. We can then call the `Unload()` method on the atlas loader +and send in the `IAtlasData` class field we created earlier. To do this, we need to add the `Velaptor.ExtensionMethods` namespace +to the top of the file. + +Add the following using statement. + +```csharp +... +using Velaptor.ExtensionMethods; // Add this line here +... +public class Game : Window +{ + ... +} +``` + +Now we can override the `OnUnload()` method and unload the font. + +```csharp +protected override void OnUnload() +{ + this.atlasLoader.Unload(this.atlasTexture); + base.OnUnload(); +} + +``` + + +## Step 7: Let's animate + +Now that we have loaded the atlas data, let's add some code to the `OnUpdate()` method to animate the sub-textures. + +### Step 7.1: Tracking time + +For us to run an animation, we need to keep track of how much time has passed. +Add the following fields to the `Game` class. + +```csharp +public class Game : Window +{ + ... + private float elapsedMs; // The total milliseconds that have passed + private int currentFrame; // The current frame of the animation + private bool isFullSize; // Whether or not the flame has grown to full size + ... +} +``` + +:::info WHY? +
Expand me for more info!! + +Think of a [flip book](https://www.youtube.com/watch?v=Un-BdBSOGKY). If you were to flip through the pages of a flip book, you would see the animation. +The faster you flip through the pages, the faster the animation will appear. The slower you flip +through the pages, the slower the animation will appear. The same concept applies to animations in games. + +The problem with software is that it runs each frame very fast. If we changed the frames of the +animation as fast as the game would run, the animation would move too fast. We need to slow down the +animation to the desired speed so that it runs smoothly. + +How fast you want to run your animation is up to you. You can make it run as fast or as slow as you want. +
+::: + +### Step 7.2: Has enough time passed? + +Add some code to the `OnUpdate()` method to check if enough time has passed to +change the frame of the animation. + +```csharp +protected override void OnUpdate(FrameTime frameTime) +{ + this.elapsedMs += (float)frameTime.ElapsedTime.TotalMilliseconds; + + // Move to the next frame every 124ms + if (this.elapsedMs >= 124) + { + // If the current frame is one of the frames after + // the flame has grown to full size. + if (this.currentFrame >= 8) + { + this.isFullSize = true; + } + + // Get the starting frame index based on if the flame has + // grown to full size or not. + var startFrame = this.isFullSize ? 8 : 0; + + // If the last frame has been reached, reset to the starting frame + this.currentFrame = this.currentFrame >= this.subTextureData.Length - 1 + ? startFrame + : this.currentFrame + 1; + + // Reset the elapsed time so we can wait for another + // 124ms before moving to the next frame + this.elapsedMs = 0; + } + + base.OnUpdate(frameTime); +} +``` + +This code will check if 124ms has passed. If it has, then it will move to the next frame of +the animation. If the last frame has been reached, then it will reset to the first frame. +Now we have our flip book!! + +The `startFrame` is the frame where the animation starts, which will be either 0 or 8. If the flame has not grown to +full size, frames 0-7 will be used. If the flame has grown to full size, frames 8-15 will be used. + +:::tip +If you want to calculate how many milliseconds it takes for a particular frame rate, just take +the value 1000 and divide it by the desired frame rate. + +_**Formula:**_ ms/sec รท fps = ms/frame. + +For example, 1000 รท 60 = 16.66ms. This means if you want to run something at 60fps, you would need to +to make something happen every 16ms to obtain that frame rate. +::: + +:::info What is FPS? +
Expand me for more info!! + +FPS stands for frames per second, which, as the name implies, is the number of frames that are rendered every second. +The game loop of a game consists of the two most important methods: `OnUpdate()` and `OnRender()`. +The `OnUpdate()` and `OnRender()` methods are called once per frame. The speed (or frequency) at +which these methods are called is what determines the FPS of the game. The faster the methods run, +the higher the FPS. + +To calculate the FPS, divide the number of frames rendered by the number of seconds that +a game loop iteration has run. For example, if a game loop iteration runs for 1 second and 60 frames, +then the FPS would be 60. If a game loop iteration runs for 1 second and 30 frames, then the FPS would +be 30. + +Since we can keep track of how much time has passed, we can calculate the FPS of the game. We can +take advantage of this time metric coming into the `OnUpdate()` and `OnDraw()` methods to have things +happen at a certain frequency. In this case, the speed at which we want our animation to run. +
+::: + + +## Step 8: Render animation + +Now we can finally render the animation to the screen. Add the following code to the `OnDraw()` method. + +```csharp +protected override void OnDraw(FrameTime frameTime) +{ + // Start the batch + IBatcher.Begin(); + + var x = (int)(Width / 2); // Center of the window horizontally + var y = (int)(Height / 2); // Center of the window vertically + + // Get the bounds of the sub-texture in the entire atlas at the current frame + var subBounds = this.subTextureData[this.currentFrame].Bounds; + + // Create the rectangle of where the frame is located in the atlas + var srcRect = new Rectangle(subBounds.X, subBounds.Y, subBounds.Width, subBounds.Height); + + // Create the rectangle of the entire atlas. + var destRect = new Rectangle(x, y, (int)this.atlasTexture.Width, (int)this.atlasTexture.Height); + + // Render only the sub-texture in the atlas at the center of the window + this.textureRenderer.Render( + this.atlasTexture, + srcRect, + destRect, + 0.25f, // Size of the sub-texture + 0f, // Angle of rotation + Color.White, // Color to tint the sub-texture + RenderEffects.None, + 1); // Render layer + + // End the batch to render the entire batch + IBatcher.End(); + + base.OnDraw(frameTime); +} +``` + +Here we are using the location data from the frame metadata to know where in the atlas +the current frame or sub-texture is located. We then render only that sub-texture to the screen. + +The `srcRect` and `destRect` variables are what tell Velaptor the _**section**_ of the atlas to render. + +## Step 9: Run it + +Run the game and see the results! You should see a small window with a blue flame +animating in the center of the window as shown below. + +:::note +The animation will be much smoother than what is shown here. +::: + +![Flame Animation](@site/static/img/tutorials/guides/rendering-atlas-textures/flame.gif) + + +## Step 10: Bonus + +You do not have to do this step of course, but what is game development without a little +bit of extra fun? Let's improve the randomness of the flame animation. + +### Step 10.1: Add more fields + +Add two more class fields to the `Game` class. The `random` field will be used to randomly choose between horizontal +or non-horizontal orientation. The `horizontalLayout` field will be the layout setting at the time of rendering. + +```csharp +public class Game: Window +{ + ... + private readonly Random random = new (); // Chooses random numbers + private RenderEffects horizontalLayout; // The horizontal orientation to render flame + ... +} +``` + +### Step 10.2: Add flip behavior + +Add the following code to randomly choose whether or not the flame should be flipped horizontally to the +bottom of the `if` block. This will choose a number between the values 0 and 1. If 0 is chosen, +the flame will be flipped horizontally. If 1 is chosen, the flame will not be flipped horizontally. + +This is synonymous with flipping a coin. + +```csharp +protected override void OnUpdate(FrameTime frameTime) +{ + this.elapsedMs += (float)frameTime.ElapsedTime.TotalMilliseconds; + + // Move to the next frame every 124ms + if (this.elapsedMs >= 124) + { + ... + // Randomly choose to have the flame flipped horizontally or not flipped at all + this.horizontalLayout = this.random.Next(0, 2) == 0 + ? RenderEffects.FlipHorizontally + : RenderEffects.None; + } + + base.OnUpdate(frameTime); +} +``` + +### Step 10.3: Run it + +Now run your game again and the flame will be a little bit more realistic to the randomness of +the orientation of the flame!! diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-text.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-text.mdx new file mode 100644 index 00000000..22b4d448 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-text.mdx @@ -0,0 +1,448 @@ +--- +sidebar_position: 3 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { TutorialLink } from "@site/src/components/TutorialLink"; + +# Rendering Text + +This guide will show you the basics of rendering text to a window using **Velaptor**. + +:::note Guide Source Code +Go to the tutorial project to see the source code for a fully working example of this guide. +::: + + +## Step 1: Create project + +Create a basic **Velaptor** application. +:::note Refer To Guide +For more info, refer to the [Project Setup](./project-setup) guide. +::: + + +## Step 2: Setup window + +Let's start simple and set the window size and title in the `Game` constructor. + +```csharp +public Game() +{ + Title = "Render Text Guide"; + Width = 800; + Height = 800; +} +``` + + +## Step 3: Loading and unload content + +### Step 3.1: Create class fields + +Create a couple class fields at the top of the class. These will be used to load the font for rendering text. + +```csharp +private ILoader fontLoader; // Loads the font content +private IFont? font; // Holds the font +``` + +### Step 3.2: Load the font + +We need to load the font and to do this we can use a loader. There are various loaders available in **Velaptor**. +The loader that we need is the `ILoader` loader and this can be created using the `ContentLoaderFactory`. +We want to keep the font loader around as a class field so we can unload the font later when shutting down the game. + +Add the following code to the `OnLoad()` method to create the font loader and load the font. + +```csharp +protected override void OnLoad() +{ + this.fontLoader = ContentLoaderFactory.CreateFontLoader(); + this.font = this.fontLoader.Load("TimesNewRoman-Regular", 24); + + base.OnLoad(); +} +``` +:::caution Warning +Since the name of the content to load is based on the name of the file, renaming the file will break your application!! +::: + +:::tip content name +The name of the content to load is the same as the content file minus the file extension. You can use or +omit the file extension when using the `this.fontLoader.Load()` method. Also, the name is not _**case-sensitive**_. +Example: The content names _**'my-texture'**_ and _**'My-Texture'**_ are equivalent. +::: + +:::info Built In Fonts +
Expand me to learn more! + +Currently, four fonts come _**built-into**_ **Velaptor** and are _**Times New Roman**_. +The 4 different font types are: +- TimesNewRoman-Regular +- TimesNewRoman-Bold +- TimesNewRoman-Italic +- TimesNewRoman-BoldItalic + +
+::: + +### Step 3.3: Unload the font + +Now we can unload the content when the game shuts down. This is to clean up resources that are no longer needed. +To do this, we can override the `OnUnload()` method. We can then call the `Unload()` method on the font loader +and send in the `IFont` class field we created earlier. To do this, we need to add the `Velaptor.ExtensionMethods` namespace +to the top of the file. + + +Add the following using statement. + +```csharp +... +using Velaptor.ExtensionMethods; // Add this line here +... +public class Game : Window +{ + ... +} +``` + +Now we can override the `OnUnload()` method and unload the font. It is always a good idea to unload +and release resources when shutting down the game or when switching to a new scene. + +```csharp +protected override void OnUnload() +{ + this.fontLoader.Unload(this.font); + base.OnUnload(); +} +``` + + +## Step 4: Rendering text + +### Step 4.1: Create renderer field + +After setting up a text renderer and selecting a font for rendering text, we can now render text on the screen using the +font renderer. To achieve this, you can add the following code to the `OnDraw()` method. + +```csharp +public class Game : Window +{ + ... + private readonly IFontRenderer fontRenderer; + ... +} +``` + +### Step 4.2: Create renderer + +Go into the `OnLoad()` method and create the font renderer. First, we create a renderer factory and then use the factory to create the renderer. + +```csharp +protected override void OnLoad() +{ + var rendererFactory = new RendererFactory(); + this.fontRenderer = rendererFactory.CreateFontRenderer(); + + base.OnLoad(); +} +``` + +### Step 4.3: Create batcher + +Create a batcher in the `OnLoad()` method. We can create a batcher using the `rendererFactory`. +We will go over what this is used in the next step. + +```csharp +protected override void OnLoad() +{ + ... + this.batcher = rendererFactory.CreateBatcher(); + + base.OnLoad(); +} +``` + +### Step 4.4: Render the text + +Now that we have a text renderer and a font to render text, we need to use the font renderer to render +some text to the screen using our font. Add the code below to the `OnDraw()` method to accomplish +this. + +Note that we need to invoke `IBatcher.Begin()` before we invoke any `Render()` methods for +any renderers and then invoke the `IBatcher.End()` when we are finished with all of our renderings. + +The X and Y values are set to 400, 400 which is the center of the window. + +```csharp +protected override void OnDraw(FrameTime frameTime) +{ + this.batcher.Begin(); + + this.fontRenderer.Render(this.font, "Hello Velaptor!", 400, 400, Color.White); + + this.batcher.End(); + + base.OnDraw(frameTime); +} +``` + +:::info What is this `IBatcher` thing? +
Expand me to learn more! + +As you might have guessed, this is used for batching. But that does not mean you know what "batching" is right? + +Let's fill you in. + +Think of a batch as a group of something. Just like a batch of cookies is a group of cookies, a batch of textures is a group of textures. +What we are doing is making **Velaptor** aware that we will be rendering a bunch of textures. By rendering textures **together**, we mean +that all of the textures will be sent to the GPU and rendered all together as a group. Once we are done **rendering**, we then +tell **Velaptor** that we are finished creating our batch and it can now be rendered to the screen. + +This is what the `IBatcher` object is used for!! + +We tell **Velaptor** that we are ready to start batching by invoking the `IBatcher.Begin()` method. We then tell **Velaptor** that +we are done batching by invoking the `IBatcher.End()` method. + +All of the rendering calls using any of the renderers should go between the `Begin()` and `End()` method calls. + +Just remember the steps: +1. Invoke `IBatcher.Begin()` method +2. Invoke all `Render()` methods for the current frame +3. Invoke the `IBatcher.End()` method + +That's it!! +
+::: + +:::info Texture And Text Origin +
Expand me to learn more! + +Some game engines and frameworks use the top left corner of an object when rendering at a particular position. +**Velaptor** does not work like that. When rendering text, the position of the text is relative to the center of +the entire text or texture content. + +What this means is if you render the text at position _**(0,0)**_, you would only be able to see the bottom right quadrant of the text because +the other 3 quadrants would be rendered off-screen!! Make sure to take this into account when it comes to text and object render positioning. +Example banner +
+::: + +:::caution NOT USING THE BATCHER +If you call a render method with any renderer before the `Begin()` method or after the `End()` method, +you will get an exception!! This is a good thing because you want to know when you are not batching correctly. +::: + +### Step 4.6: See the result + +Now for the best part!! Let's see the fruits of your labor and run the application. +You should see the result below!! ๐Ÿฅณ +Example banner + + +## Step 5: Bonus!!! + +Now it's time to add some polish to what we just did. Let's add some color to the text and make it move around the screen. +Better yet, let's move the text around the screen and have it bounce off of the edges of the screen. + +Every time the text bounces off the edge of the screen, we can change the color of the text to a random color. + +### Step 5.1: Class fields + +To accomplish the bouncing of the text off the edges of the screen, we need to keep track of the position +and velocity of the text. Also, add the text that will be rendered as a `string` constant as a class field as well. + +You will see where this comes in later. + +The velocity is what directly influences the movement of the text. The velocity is a vector that represents +the direction and magnitude of the text's movement. The position is the current position of the text on the screen. + + +```csharp +public class Game : Window +{ + ... + private const string Text = "Hello Velaptor!"; + private Vector2 velocity = new (100, 100); + private Vector2 position = new (400, 400); + ... +} +``` + +### Step 5.2: Screen collision detection + +To detect if the text is colliding with the edge of the screen, we need to check if the text is outside of the screen's bounds. +The screen bounds are made up of the four sides of the screen the left, top, right, and bottom. The left and top +locations of the screen are always 0, 0. This is because the origin of the screen area is the top left corner. + +As for the right and bottom locations of the screen, we can get those by using the `Width` and `Height` properties of the `Window` class. + +Now that we have enough information about the window that represents the 'world' that the text lives in, we need to get some more information +about the text itself. The information we need is the width and height of the text. To get this information, you can use the 'IFont' +content we created in the `OnLoad()` method. + +Font objects have a `Measure()` method that returns a `SizeF` type that represents the width and height of the text. + +To process all of this information, create a method with the name `ProcessCollisionAndColor()`. This method will perform both the collision +detection as well as updating the new color of the text on collision. + +```csharp +private void ProcessCollisionAndColor() +{ + var textSize = this.font.Measure(Text); + var halfWidth = textSize.Width / 2; + var halfHeight = textSize.Height / 2; + + var leftSide = this.position.X - halfWidth; + var top = this.position.Y - halfHeight; + var rightSide = this.position.X + halfWidth; + var bottom = this.position.Y + halfHeight; + + if (leftSide <= 0) + { + this.velocity.X *= -1; + } + + if (top <= 0) + { + this.velocity.Y *= -1; + } + + if (rightSide >= Width) + { + this.velocity.X *= -1; + } + + if (bottom >= Height) + { + this.velocity.Y *= -1; + } +} +``` + +Looking at the code, you can see how the positions of the sides of the text are calculated. Since the position +of the text is relative to the center of the text, we need to subtract or add half of the width and height of +the text from the position to get the left, top, right, and bottom positions. + +With this information, we can then compare it against the sides of the window. If a collision occurs, we just +flip the sign of the X and/or Y velocity by negating it. Negating the velocity changes the direction of the +text's movement. This is just vector math. + +### Step 5.3: Update position with collision + +Now all we have to do is process the collision and update the position of the text. We can do this in the `OnUpdate()` method. + +In the `OnUpdate()` method, add the following. + +```csharp +protected override void OnUpdate(FrameTime frameTime) +{ + ProcessCollisionAndColor(); + var displacement = this.velocity * (float)frameTime.ElapsedTime.TotalSeconds; + this.position += displacement; + + base.OnUpdate(frameTime); +} +``` + +First, we process any collision and then we just the updated velocity that determines the direction of the text's movement +to help calculate the new position of the text. + +:::tip CHANGING THE SPEED +To change the speed of the text, we can change the `X` and `Y` values of the `velocity` vector class field. + +Remember, velocity is a representation of 2 things, direction and magnitude. The larger the numbers, the faster the text will move. +If the number is negative, it will move in the opposite direction of the positive number. +::: + +### Step 5.4: Changing the color + +To change the color, we can use the `Random` class to generate a random color. +Create 2 more class fields. One for creating random numbers and one for holding the color of the text. + +```csharp +public class Game : Window +{ + ... + private readonly Random random = new (); + private Color textColor = Color.White; + ... +} +``` + +Let's make a method with the name `RandomizeColor()` that will take care of this so we don't have to duplicate so much code. ๐Ÿ˜‰ + +```csharp +private void RandomizeColor() +{ + var red = this.random.Next(0, 255); // Create a random red value + var green = this.random.Next(0, 255); // Create a random green value + var blue = this.random.Next(0, 255); // Create a random blue value + + // Set the text color + this.textColor = Color.FromArgb(255, red, green, blue); +} +``` + +### Step 5.5: Update the color + +Now that we have our little helper method, we can use it in the `ProcessCollisionAndColor()` method. +Add a call to the `RandomizeColor()` method in each of the `if` statements that check for a collision. + +```csharp +private void ProcessCollision() +{ + ... + if (leftSide <= 0) + { + this.velocity.X *= -1; + RandomizeColor(); // Add this line + } + + if (top <= 0) + { + this.velocity.Y *= -1; + RandomizeColor(); // Add this line + } + + if (rightSide >= Width) + { + this.velocity.X *= -1; + RandomizeColor(); // Add this line + } + + if (bottom >= Height) + { + this.velocity.Y *= -1; + RandomizeColor(); // Add this line + } +} +``` + +### Step 5.6: Finishing up + +Now the exciting part!! Let's update the `OnDraw()` method to use our `position` and `textColor` class fields. +No point in doing all of this hard work if we can see it. + + +```csharp +protected override void OnDraw(FrameTime frameTime) +{ + this.batcher.Begin(); + + this.fontRenderer.Render(this.font, Text, (int)this.position.X, (int)this.position.Y, this.textColor); + + this.batcher.End(); + + base.OnDraw(frameTime); +} +``` + +The only change to this method is the `Render()` call itself. We just swapped out our hard-coded text, +X and Y position, and color with the class fields we created. + +Now run the application!! + +You should see the text bouncing off the edges of the window and with each bounce, the color should change. diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-textures.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-textures.mdx new file mode 100644 index 00000000..518731fd --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/rendering-textures.mdx @@ -0,0 +1,151 @@ +--- +sidebar_position: 4 +--- + +import { TutorialLink } from "@site/src/components/TutorialLink"; + +# Rendering Textures + +A game cannot be a game without having the ability to render textures. This guide will show you how to render whole +textures to the screen. + +:::note Guide Source Code +Go to the tutorial project to see the source code for a fully working example of this guide. +::: + + +## Step 1: Project setup + +Create a basic Velaptor application. +:::note Refer To Guide +For more info, refer to the [Project Setup](./project-setup) guide. +::: + + +## Step 2: Rendering a texture + +### Step 2.1: Create class fields + +Create the class fields shown below. These will be used to render the Velaptor mascot texture to the screen. + +```csharp +public class Game : Window +{ + private readonly IBatcher batcher; // Used to control batching + private readonly ITextureRenderer textureRenderer; // Renders textures + private ITexture? mascotTexture; // The texture to render + private ILoader? textureLoader; // Used to load textures + ... +} +``` + +### Step 2.2: Create renderer & batcher + +In the constructor, create a render factory to create a renderer and batcher. + +```csharp +public Game() +{ + var rendererFactory = new RendererFactory(); // Creates renderers + this.textureRenderer = rendererFactory.CreateTextureRenderer(); // Renders textures + + this.batcher = rendererFactory.CreateBatcher(); // Create a batcher +} +``` + + +## Step 3: Load and unload the content + +Loading and unloading content is a very important part of game development. It is also important to unload the content +when it is not needed or used anymore. In the next couple of steps, we will setup the loading and unloading of the texture. + +### Step 3.1: Get the content + +Download or create any _**.png**_ file you want. + +:::info Velaptor Mascot Image +You can download the Velaptor mascot here +::: + +### Step 3.2: Add the content + +Add the image to the project and set it as content by following the steps in the [Adding Content](./adding-content) tutorial. +Make sure to add the image to the `Content/Graphics` folder in the project. + +### Step 3.3: Load the texture content + +Now that our content has been successfully added to the project, we can now move on to loading the texture and +rendering it!! Let's load the texture to the class field in the `OnLoad()` method. + +We need to load the texture and to do this we can use a loader. There are various loaders available in **Velaptor**. +The loader that we need is the `ILoader` loader and this can be created using the `ContentLoaderFactory`. + +Add the following code to the `OnLoad()` method to create the texture loader and load the texture. + +```csharp +protected override void OnLoad() +{ + this.textureLoader = ContentLoaderFactory.CreateFontLoader(); + this.mascotTexture = this.textureLoader.Load("velaptor-mascot"); + + base.OnLoad(); +} +``` + +### Step 3.4: Unload the texture content + +Now we can unload the content when the game shuts down. This is to clean up resources that are no longer needed. +To do this, we can override the `OnUnload()` method. We can then call the `Unload()` method on the font loader +and send in the `IFont` class field we created earlier. To do this, we need to add the `Velaptor.ExtensionMethods` namespace +to the top of the file. + + +Add the following using statement. + +```csharp +... +using Velaptor.ExtensionMethods; // Add this line here +... +public class Game : Window +{ + ... +} +``` + +Now we can override the `OnUnload()` method and unload the font. + +```csharp +protected override void OnUnload() +{ + this.textureLoader.Unload(this.mascotTexture); + base.OnUnload(); +} + +``` + +## Step 4: Render the texture + +Finally, we can get to rendering our image. Add the code below to the `OnDraw()` method. + +```csharp +protected override void OnDraw(FrameTime frameTime) +{ + IBatcher.Begin(); + + var x = (int)(Width / 2); // Center of the window horizontally + var y = (int)(Height / 2); // Center of the window vertically + + // Render the mascot image in the center of the window + this.textureRenderer.Render(this.mascotTexture, x, y); + + IBatcher.End(); + + base.OnDraw(frameTime); +} +``` + + +## Step 5: Run it + +Run the application. You should see the result below!! +Example banner diff --git a/versioned_docs/version-1.0.0-preview.30/guides/guides/sounds.mdx b/versioned_docs/version-1.0.0-preview.30/guides/guides/sounds.mdx new file mode 100644 index 00000000..eb416501 --- /dev/null +++ b/versioned_docs/version-1.0.0-preview.30/guides/guides/sounds.mdx @@ -0,0 +1,317 @@ +--- +sidebar_position: 8 +--- + +import { Audio } from "@site/src/components/Audio"; +import { TutorialLink } from "@site/src/components/TutorialLink"; + +# Sounds + +:::note Guide Source Code +Go to the tutorial project to see the source code for a fully working example of this guide. +::: + +Can you imagine playing Mario Brothers games without the **jump** sound effect? How about playing Metroid with no amazing music +and no weapon sound effects? Sounds are a great way to add some life to your game. Whether it is background music or sound +effects, Velaptor has you covered. + +Check out some of these sounds!! They might bring back memories. ๐Ÿ˜‰ + + + + + + +
+ + +
+ + +## Step 1: Project setup + +Create a basic Velaptor application. + +:::note Refer To Guide +For more info, refer to the [Project Setup](./project-setup) guide. +You only need the `OnLoad()` and `OnUpdate()` methods. +::: + +## Step 2: Create class fields + +Create the required class fields that will be used to get the keyboard input, hold the previous keyboard state for +each loop iteration, load the sound content, and hold the loaded sound. + +```csharp +public class Game : Window +{ + private IAppInput? keyboard; + private KeyboardState prevKeyState; + private ILoader? soundLoader; + private ISound? music; + ... +} +``` + +## Step 3: Setup window + +Let's set up our window to not be so large. Create a `Game()` constructor and add the following code: + +```csharp +public Game() +{ + Width = 900; + Height = 600; +} +``` + + +## Step 4: Load and unload the content + +Now, let's proceed with loading the sound as audio content for playback. Before we delve into the code for loading the +audio content, it's crucial to add the audio file to the project as content. This step ensures it can be loaded. +Once that's finished, we can enhance the functionality by adding code into the `OnLoad()` method. This code will enable +us to load the audio content and create a keyboard input object. By utilizing the keyboard, we'll be able to easily +control the audio playback. + +:::info Supported Audio Formats +Currently, the supported audio formats are _**.mp3**_ and _**.ogg**_. +::: + +### Step 4.1: Get audio content + +You can provide whatever audio file you want, but if you don't have one, you can download the original tutorial project +sound [here](https://github.com/KinsonDigital/VelaptorTutorials/raw/master/Sounds/Content/Sounds/deep-consistency.ogg). + +Play it to see if you like it. ๐Ÿ˜€ +