var searchIndex = {}; searchIndex["immi"] = {"doc":"# Immediate mode UI and general application architecture","items":[[3,"WidgetId","immi","Represents an identifier of a widget. See the documentation of `DrawContext`.",null,null],[3,"Alignment","","Represents the alignment of a viewport.",null,null],[12,"horizontal","","The horizontal alignment.",0,null],[12,"vertical","","The vertical alignment.",0,null],[3,"DrawContext","","Contains everything required to draw a widget.",null,null],[3,"SharedDrawContext","","A context shared between all draw contexts.",null,null],[3,"Matrix","","A 2x3 matrix. The data is stored in column-major.",null,null],[12,"0","","",1,null],[3,"UiState","","Contains some persistent info about the UI.",null,null],[12,"active_widget","","Identifier of the widget that is currently active.",2,null],[4,"HorizontalAlignment","","Describes a horizontal alignment.",null,null],[13,"Center","","Align in the middle.",3,null],[13,"Left","","Align left.",3,null],[13,"Right","","Align right.",3,null],[4,"VerticalAlignment","","Describes a vertical alignment.",null,null],[13,"Center","","Align in the middle.",4,null],[13,"Top","","Align top.",4,null],[13,"Bottom","","Align bottom.",4,null],[5,"draw","","Start drawing your UI.",null,{"inputs":[{"name":"uistate"}],"output":{"name":"shareddrawcontext"}}],[11,"eq","","",5,null],[11,"ne","","",5,null],[11,"fmt","","",5,null],[11,"clone","","",5,null],[11,"from","","",5,{"inputs":[{"name":"usize"}],"output":{"name":"widgetid"}}],[11,"draw","","",6,null],[11,"cursor_hovered_widget","","Returns true if one of the elements that has been drawn is under the mouse cursor.",6,null],[11,"draw","","UNSTABLE. Obtains the underlying `draw` object.",7,null],[11,"matrix","","",7,null],[11,"cursor_was_pressed","","Returns true if the cursor went from up to down in the current frame.",7,null],[11,"cursor_was_released","","Returns true if the cursor went from down to up in the current frame.",7,null],[11,"cursor_hovered_widget","","Returns true if one of the elements that has been drawn is under the mouse cursor.",7,null],[11,"set_cursor_hovered_widget","","Signals the context that the cursor is currently hovering it. This can be later retreived\nwith `cursor_hovered_widget()`.",7,null],[11,"reserve_widget_id","","",7,null],[11,"get_active_widget","","",7,null],[11,"write_active_widget","","",7,null],[11,"clear_active_widget","","",7,null],[11,"is_cursor_hovering","","Returns true if the cursor is currently hovering this part of the viewport.",7,null],[11,"width_per_height","","Returns the ratio of the width of the surface divided by its height.",7,null],[11,"margin","","Builds a new draw context containing a subpart of the current context, but with a margin.",7,null],[11,"uniform_margin","","Builds a new draw context containing a subpart of the current context, but with a margin.",7,null],[11,"enforce_aspect_ratio_downscale","","Modifies the layout so that the given width per height ratio is respected. The size of the\nnew viewport will always been equal or small to the existing viewport.",7,null],[11,"enforce_aspect_ratio_upscale","","Modifies the layout so that the given width per height ratio is respected. The size of the\nnew viewport will always been equal or greater to the existing viewport.",7,null],[11,"vertical_rescale","","Builds a new draw context containing a subpart of the current context. The width of the new\nviewport will be the same as the current one, but its new height will be multipled by\nthe value of `scale`.",7,null],[11,"horizontal_rescale","","Builds a new draw context containing a subpart of the current context. The height of the new\nviewport will be the same as the current one, but its new width will be multipled by\nthe value of `scale`.",7,null],[11,"vertical_split","","Splits the viewport in `splits` vertical chunks of equal size.",7,null],[11,"vertical_split_weights","","Same as `vertical_split`, but attributes a weight to each chunk. For example a chunk of\nweight 2 will have twice the size of a chunk of weight 1.",7,null],[11,"horizontal_split","","Splits the viewport in `splits` horizontal chunks of equal size.",7,null],[11,"horizontal_split_weights","","Same as `horizontal_split`, but attributes a weight to each chunk. For example a chunk of\nweight 2 will have twice the size of a chunk of weight 1.",7,null],[11,"rescale","","Changes the dimensions of the context.",7,null],[11,"animate","","",7,null],[11,"clone","","",7,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"fmt","","",0,null],[11,"clone","","",0,null],[11,"center","","Shortcut for `(center, center)`.",0,{"inputs":[],"output":{"name":"alignment"}}],[11,"bottom","","Shortcut for `(center, bottom)`.",0,{"inputs":[],"output":{"name":"alignment"}}],[11,"top","","Shortcut for `(center, top)`.",0,{"inputs":[],"output":{"name":"alignment"}}],[11,"right","","Shortcut for `(right, center)`.",0,{"inputs":[],"output":{"name":"alignment"}}],[11,"left","","Shortcut for `(left, center)`.",0,{"inputs":[],"output":{"name":"alignment"}}],[11,"top_left","","Shortcut for `(left, top)`.",0,{"inputs":[],"output":{"name":"alignment"}}],[11,"top_right","","Shortcut for `(right, top)`.",0,{"inputs":[],"output":{"name":"alignment"}}],[11,"bottom_right","","Shortcut for `(right, bottom)`.",0,{"inputs":[],"output":{"name":"alignment"}}],[11,"bottom_left","","Shortcut for `(left, bottom)`.",0,{"inputs":[],"output":{"name":"alignment"}}],[11,"eq","","",3,null],[11,"fmt","","",3,null],[11,"clone","","",3,null],[11,"eq","","",4,null],[11,"fmt","","",4,null],[11,"clone","","",4,null],[11,"eq","","",1,null],[11,"ne","","",1,null],[11,"fmt","","",1,null],[11,"clone","","",1,null],[11,"identity","","Builds an identity matrix, in other words a matrix that has no effect.",1,{"inputs":[],"output":{"name":"matrix"}}],[11,"scale","","Builds a matrix that will rescale both width and height of a given factor.",1,{"inputs":[{"name":"f32"}],"output":{"name":"matrix"}}],[11,"scale_wh","","Builds a matrix that will multiply the width and height by a certain factor.",1,{"inputs":[{"name":"f32"},{"name":"f32"}],"output":{"name":"matrix"}}],[11,"translate","","Builds a matrix that will translate the object.",1,{"inputs":[{"name":"f32"},{"name":"f32"}],"output":{"name":"matrix"}}],[11,"rotate","","Builds a matrix that will rotate the object.",1,{"inputs":[{"name":"f32"}],"output":{"name":"matrix"}}],[11,"skew_x","","Builds a matrix that will skew the x coordinate by a certain angle.",1,{"inputs":[{"name":"f32"}],"output":{"name":"matrix"}}],[11,"mul","","",1,null],[11,"mul","","",1,null],[11,"into","","",1,null],[11,"into","","",1,null],[0,"animations","","Contains everything related to the animations that are supported by this library.",null,null],[3,"Translation","immi::animations","Relative movement of the element from `initial_offset` to `[0.0, 0.0]`.",null,null],[12,"initial_offset","","The initial position of the element at the start of the animation.",8,null],[3,"Zoom","","Zooms the element from `initial_zoom` to `1.0`.",null,null],[12,"initial_zoom","","The initial zoom of the element at the start of the animation.",9,null],[3,"Linear","","A linear animation. The animation progresses at a constant rate.",null,null],[3,"EaseOut","","An ease-out animation. The animation progresses quickly and then slows down before reaching its\nfinal position.",null,null],[12,"factor","","The formula is `1.0 - exp(-linear_progress * factor)`.",10,null],[8,"Animation","","Describes a way to modify an element during an animation.",null,null],[10,"animate","","Takes an animation percentage between `0.0` and `1.0`. Returns the most-inner matrix to\nmultiply the element with.",11,null],[8,"Interpolation","","Describes how an animation should be interpolated.",null,null],[10,"calculate","","Takes a number of ticks (in nanoseconds) representing the current point in time, a number\nof ticks representing the point in time when the animation has started or will start, the\nduration in nanoseconds, and returns a value between 0.0 and 1.0 representing the progress\nof the animation.",12,null],[11,"new","","Builds a `Translation` object.",8,null],[11,"animate","","",8,null],[11,"new","","Builds a `Zoom` object.",9,{"inputs":[{"name":"f32"}],"output":{"name":"zoom"}}],[11,"animate","","",9,null],[11,"fmt","","",13,null],[11,"default","","",13,{"inputs":[],"output":{"name":"linear"}}],[11,"clone","","",13,null],[11,"calculate","","",13,null],[11,"fmt","","",10,null],[11,"clone","","",10,null],[11,"new","","Builds a `EaseOut` object.",10,{"inputs":[{"name":"f32"}],"output":{"name":"easeout"}}],[11,"default","","",10,{"inputs":[],"output":{"name":"easeout"}}],[11,"calculate","","",10,null],[0,"widgets","immi","",null,null],[4,"Interaction","immi::widgets","Whether the cursor clicked on the widget.",null,null],[13,"Clicked","","The cursor clicked.",14,null],[13,"None","","The cursor didn't click.",14,null],[0,"circular_progress_bar","","A circular progress bar is a circle that fills itself to indicate some sort of progression.",null,null],[5,"draw","immi::widgets::circular_progress_bar","Draws a circular progress bar and keeps the aspect ratio of the empty image.",null,{"inputs":[{"name":"drawcontext"},{"name":"imageresource"},{"name":"imageresource"},{"name":"f32"},{"name":"alignment"}],"output":null}],[5,"stretch","","Draws a circular progress bar, stretching it over the whole area.",null,{"inputs":[{"name":"drawcontext"},{"name":"imageresource"},{"name":"imageresource"},{"name":"f32"}],"output":null}],[0,"image","immi::widgets","",null,null],[5,"draw","immi::widgets::image","",null,{"inputs":[{"name":"drawcontext"},{"name":"imageresource"},{"name":"alignment"}],"output":null}],[5,"stretch","","",null,{"inputs":[{"name":"drawcontext"},{"name":"imageresource"}],"output":null}],[5,"cover","","Increases the size of the image until it covers the context, and draws it.",null,{"inputs":[{"name":"drawcontext"},{"name":"imageresource"},{"name":"alignment"}],"output":null}],[0,"image9","immi::widgets","",null,null],[5,"draw","immi::widgets::image9","Draws a 9-parts image.",null,{"inputs":[{"name":"drawcontext"},{"name":"f32"},{"name":"imageresource"},{"name":"f32"},{"name":"f32"},{"name":"f32"},{"name":"f32"}],"output":null}],[0,"image_button","immi::widgets","",null,null],[5,"draw","immi::widgets::image_button","",null,{"inputs":[{"name":"drawcontext"},{"name":"imageresource"},{"name":"imageresource"},{"name":"imageresource"},{"name":"alignment"}],"output":{"name":"interaction"}}],[5,"stretch","","",null,{"inputs":[{"name":"drawcontext"},{"name":"imageresource"},{"name":"imageresource"},{"name":"imageresource"}],"output":{"name":"interaction"}}],[0,"image9_button","immi::widgets","",null,null],[5,"draw","immi::widgets::image9_button","",null,{"inputs":[{"name":"drawcontext"},{"name":"f32"},{"name":"imageresource"},{"name":"imageresource"},{"name":"imageresource"},{"name":"f32"},{"name":"f32"},{"name":"f32"},{"name":"f32"}],"output":{"name":"interaction"}}],[0,"label","immi::widgets","",null,null],[5,"contain","immi::widgets::label","",null,null],[5,"cover","","",null,null],[5,"flow","","The text will use the current height and will stretch horizontally as needed to preserve the\ncorrect aspect ratio.",null,null],[0,"progress_bar","immi::widgets","A progress bar is a rectangle that fills itself to indicate some sort of progression.",null,null],[5,"draw","immi::widgets::progress_bar","Draws a progress bar and keeps the aspect ratio of the empty image.",null,{"inputs":[{"name":"drawcontext"},{"name":"imageresource"},{"name":"imageresource"},{"name":"f32"},{"name":"horizontalalignment"},{"name":"alignment"}],"output":null}],[5,"stretch","","Draws a progress bar, stretching it over the whole area.",null,{"inputs":[{"name":"drawcontext"},{"name":"imageresource"},{"name":"imageresource"},{"name":"f32"},{"name":"horizontalalignment"}],"output":null}],[11,"eq","immi::widgets","",14,null],[11,"clone","","",14,null],[11,"fmt","","",14,null],[8,"Draw","immi","Trait for a context that can handle drawing.",null,null],[16,"ImageResource","","Type of a resource that represents an image.",15,null],[16,"FontResource","","Type of a resource that represents a font.",15,null],[10,"draw_triangle","","Draws a single triangle that covers the top-left hand corner of the surface, multiplied\nby the matrix. In other words, the OpenGL positions of the triangle are `[-1.0, 1.0]`,\n`[-1.0, -1.0]` and `[1.0, 1.0]`.",15,null],[11,"draw_image","","Draws an image that covers the whole surface (from `-1.0` to `1.0` both horizontally and\nvertically), but multiplied by the matrix.",15,null],[11,"draw_image_uv","","Draws an image that covers the whole surface (from `-1.0` to `1.0` both horizontally and\nvertically), but multiplied by the matrix.",15,null],[10,"get_image_width_per_height","","Given an image, this functions returns its width divided by its height.",15,null],[10,"draw_text","","Draws an image that covers the whole surface (from `-1.0` to `1.0` both horizontally and\nvertically), but multiplied by the matrix.",15,null],[10,"get_text_width_per_em","","Given a font and a text, this function returns the width the text would have on the screen,\ndivided by the size of a EM.",15,null],[11,"eq","","",2,null],[11,"ne","","",2,null],[11,"default","","",2,{"inputs":[],"output":{"name":"uistate"}}],[11,"clone","","",2,null],[11,"draw_image","","Draws an image that covers the whole surface (from `-1.0` to `1.0` both horizontally and\nvertically), but multiplied by the matrix.",15,null],[11,"draw_image_uv","","Draws an image that covers the whole surface (from `-1.0` to `1.0` both horizontally and\nvertically), but multiplied by the matrix.",15,null]],"paths":[[3,"Alignment"],[3,"Matrix"],[3,"UiState"],[4,"HorizontalAlignment"],[4,"VerticalAlignment"],[3,"WidgetId"],[3,"SharedDrawContext"],[3,"DrawContext"],[3,"Translation"],[3,"Zoom"],[3,"EaseOut"],[8,"Animation"],[8,"Interpolation"],[3,"Linear"],[4,"Interaction"],[8,"Draw"]]}; initSearch(searchIndex);