Announcement

Collapse
No announcement yet.

fill combo box with resolutions for a specific aspect ratio

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    fill combo box with resolutions for a specific aspect ratio

    I want to make a combobox with all supported resolutions but with only specific aspect ratios, kinda like how half-life 2 does it with a second combobox with aspect ratios in it

    #2
    If you divide 16 by 9, you get approximately 1.78. If you divide 1280 by 720 (a known 16:9 resolution) then you'll get the same number.

    When you're adding entries to your combobox, you can first check if the width divided by the height of that resolution "IsNearlyEqual" to the number you get when you divide the two numbers in the aspect ratio.

    Pseudocode:
    if (ScreenWidth/ScreenHeight == 16/9) { AddToComboBox(); }

    If you're working in blueprints, you should use the IsNearlyEqual node to avoid float inaccuracy problems.
    iTween For UE4
    Procedural pathed animation for actors, components & UMG - $0
    Runtime DataTable
    DataTables dynamically loaded from text or Google Sheets while your game is running!
    easyCSV
    Fast, cheap, and accurate CSV parsing at runtime!

    Comment


      #3
      oh yeah I tried that but I used the IsEqual node so it just didn't fill the box, I didn't know the IsNearlyEqual node existed thanks

      Comment


        #4
        make sure to use isNearlyEqual with an epsilon < 0.1, otherwise it will be true for 16:9 (1.6) and 16:10 (1.77778)

        Comment


          #5
          is the epsilon the error tolerance?

          Comment


            #6
            ignore my previous reply about the epsilon I already figured it out

            Comment

            Working...
            X