#Retrieve window size from a system

4 messages · Page 1 of 1 (latest)

dreamy ruin
#

Before Bevy 0.9, in my system I could this:

    pub fn create_board(
        mut commands: Commands,
        window: Res<WindowDescriptor>,
        ...
    ) {
      ...
      let max_width = window.width / width as f32;
      ...
    }
```, but now WindowDescriptor is not a resource. How do I retreive this information now?
sweet shale
#

IIRC that descriptor was never supposed to be used by systems afterwards - it was for plugin config

#

Something like rs pub fn create_board( mut commands: Commands, windows: Res<Windows>, ... ) { let max_width = windows.primary().width() / width as f32;