Skip to content

Instantly share code, notes, and snippets.

View oceantume's full-sized avatar

Gabriel Bourgeois oceantume

  • Montreal, Canada
View GitHub Profile
@oceantume
oceantume / child_builder_test.rs
Last active September 18, 2022 06:05
Unit test for Inconsistent empty Children component between hierarchy commands
#[cfg(test)]
mod tests {
use super::{BuildChildren, BuildWorldChildren};
use crate::prelude::{Children, Parent};
use smallvec::{smallvec, SmallVec};
use bevy_ecs::{
component::Component,
entity::Entity,
system::{CommandQueue, Commands},
@oceantume
oceantume / builder.rs
Last active March 6, 2022 21:35
Lifetime issues with EntityCommands
use bevy_ecs::{prelude::*, system::EntityCommands};
use bevy_math::prelude::*;
use bevy_text::*;
use bevy_transform::hierarchy::BuildChildren;
use bevy_ui::{entity::*, *};
use super::TooltipTextUiNode;
pub struct TooltipBuilder<'a, 'w, 's> {
commands: &'a mut Commands<'w, 's>,
@oceantume
oceantume / tooltip_example.rs
Created March 5, 2022 14:13
Bevy Widgets Experiments - Tooltip
use bevy::prelude::*;
use bevy_ui_widgets::tooltip::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(TooltipPlugin)
.add_startup_system(setup)
.add_system(setup_text)
.run();