Render: getWindowWidth

getWindowWidth()
  • Returns the width of the game window in pixels.

Return Type: 

  • integer 
    Sample Code

    ################  get the width of the game window

    # import bge module
    import bge

    # get the render module
    rend = bge.render

    # get window width
    width = rend.getWindowWidth()