![]() It can be disabled by setting the scroll_behavior to ScrollBehavior::Instant. void SetDefaultScrollBehavior ( ScrollBehavior scroll_behavior, float speed_factor ) īy default, smooth scrolling is enabled. / speed_factor A factor for adjusting the final smooth scrolling speed, must be strictly positive, defaults to 1.0. / scroll_behavior The default smooth scroll behavior, set to instant to disable smooth scrolling. / Sets the default scroll behavior, such as for mouse wheel processing and scrollbar interaction. This affects all scroll actions with auto scroll behavior, including mouse wheel and scrollbar interaction. The default smooth scroll behavior can be configured on the context, and is enabled by default. When calling any of the Element::Scroll.() methods using ScrollBehavior::Smooth or ScrollBehavior::Auto.When clicking a scrollbar’s arrow keys or track.During a call to Context::ProcessMouseWheel().Smooth scrolling can be activated in several situations: Smooth scrolling makes a given scroll action animate smoothly towards its destination. This scrolls the document with a controllable velocity based on the mouse cursor’s distance from its initial activation position. Autoscroll modeĪutoscroll mode is activated by pressing or holding the middle mouse button. An element’s closest scrollable ancestor is decided by scroll chaining, which can be controlled using the overflow-behavior property. In some situations, a scroll action initiates smooth scrolling. See the input documentation for more details on these functions. Further, an element’s scrollbar can be dragged, or its scroll position programmatically set.ProcessMouseButtonDown() can activate autoscroll mode when the middle mouse button is submitted.ProcessMouseWheel() may initiate a scroll action on the hover element’s closest scrollable ancestor.The context can initiate scrolling in multiple ways: If an Rml::ElementDocument is instanced, it will be added to the context and returned. The context will attempt to instance an element using the instancer specified by the caller, ‘body’ by default. ElementDocument * CreateDocument ( const String & instancer_name = "body" ) / The new document, or nullptr if no document could be created. / instancer_name The name of the instancer used to create the document. / Creates a new, empty document and places it into this context. ![]() To create a new context, use the Rml::CreateContext() function. When the context was rendered, it would need to be transformed correctly to fit onto the surface or rendered onto a texture. As they wouldn’t necessarily be viewed parallel to the screen, mouse input would need to be projected onto the surface. In-world interfacesĬomputer terminals or consoles in a 3D game world could themselves be RmlUi contexts. This could be very useful for interface-heavy games where the user may have several windows open at once, more than could fit easily onto one screen. Multiple desktopsĪ second or subsequent context could be used to store alternative ‘desktops’ that the user could switch to, in a similar fashion to many Linux desktops. Multiple contexts could be used however for a number of different reasons. Most games will feature a single context for the main interface. Contexts are rendered, updated and given input independently of each other at the application’s discretion. All documents exist within a single context. RmlUi contexts are independent collections of documents. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |