Announcement

Collapse
No announcement yet.

Resolution of Screen

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

    Resolution of Screen

    hi all,
    to change resolution of screen i use the below code,
    I want to accomplish this from a flash file,i would write a function like this in my action script:

    import flahs.external.ExternalInterface;
    function SetRes(x:number , y:number , optionalFullScreen:string)
    {
    ExternalInterface.Call("FlashToConsole","setres "+x+"×"+y+optionalFullScreen);
    }

    on the Unreal Side:
    function FlashToConsole(string command)
    {
    ConsoleCommand(command);
    }

    but it doesn't work at all,i don't see effect of this code.
    what's problem?
    how can i change resolution of screen dynamically?
    is there any idea?
    thanks

    #2
    Originally posted by fariba View Post
    hi all,
    to change resolution of screen i use the below code,
    I want to accomplish this from a flash file,i would write a function like this in my action script:

    import flahs.external.ExternalInterface;
    function SetRes(x:number , y:number , optionalFullScreen:string)
    {
    ExternalInterface.Call("FlashToConsole","setres "+x+"×"+y+optionalFullScreen);
    }

    on the Unreal Side:
    function FlashToConsole(string command)
    {
    ConsoleCommand(command);
    }


    but it doesn't work at all,i don't see effect of this code.
    what's problem?
    how can i change resolution of screen dynamically?
    is there any idea?
    thanks
    One thing is to take note of which resolutions your graphic cards supports, if you try to change into a resolution which isn't supported, nothing might happen, and also, I see you've taken my theoretic code by heart, but the correct syntax would be: setres 1900x1200f for 1900 x 1200 resolution in fullscreen and 1900x1200w for the same resolution in windowed, which you actually have to provide a "f" or "w" into the optionalFullScreen, are you doing that? the x between 1900 and 1200 isa lowercase x by the way.

    Also: are you sure that both functions fires off as expected? and have you tried to put a `log statement in FlashToConsole and see what kind of ConsoleCommand it tries to do?

    Comment


      #3
      ba salam va arze adab,

      man baraye taghire resolution safhe be sorat dynamic, in rahoo pishnahad midam:

      ba estefade az flash ye UI besazid va ye combo box va ye button to UI gharar bedid va tamame resolutionhaye morede nazaretono ba estefade az action script be combo box add konid. badesh ba estefade az UnrealScript ye handler vase UI benevisid (daghighan be raveshi ke ghablan baratoon ferestadam) va to roydad click button mojod dar UI, console command "setres" ro estefade konid.

      age bazam moshkeleton hal nashod to hamin thread matrah konid ta raveshiyo ke dar bala tozih dadam, be sorat ye tutorial baraton beferestam.

      pirooz bashid va khodahafez.

      Comment


        #4
        Originally posted by Charleon View Post
        One thing is to take note of which resolutions your graphic cards supports, if you try to change into a resolution which isn't supported, nothing might happen, and also, I see you've taken my theoretic code by heart, but the correct syntax would be: setres 1900x1200f for 1900 x 1200 resolution in fullscreen and 1900x1200w for the same resolution in windowed, which you actually have to provide a "f" or "w" into the optionalFullScreen, are you doing that? the x between 1900 and 1200 isa lowercase x by the way.

        Also: are you sure that both functions fires off as expected? and have you tried to put a `log statement in FlashToConsole and see what kind of ConsoleCommand it tries to do?
        thanks Charleon,
        yes,i used your code and i provide a "f" into optionalFullScreen(it was initialized in init function in action script)
        my code in action script is:

        import flash.external.ExternalInterface;
        var width:number;
        var height:number;
        var optionalFullScree:string;

        function init()
        {
        width=1024;
        height=768;
        optionalFullScreen="f";
        }
        ResolutionButton.addEventListener("click",this,"Pr essResolutionButton");

        function PressResolutionButton()
        {
        SetRes(width,height,optionalFullScreen);
        }

        function SetRes(WidthValue:number , HeightValue:number , Optional:string)
        {
        ExternalInterface.Call("FlashToConsole","setres "+WidthValue+"×"+HightValue+Optional);
        }

        on the Unreal side:
        function FlashToCosole(string command)
        {
        ConsoleCommand(command);
        }
        and init function in action script was called before.

        yes,i use `log function in FlashToConsole function in unreal script,the string that i see in log window is: setres 1024A-768f
        note:for multiply symbol between width and height i copy × symbol from office word so in log window i see A character instead of ×.
        i think the problem relation × symbol.
        what do you think?
        do i should use * or × for multiply symbol between width and height?
        do this problem relation × symbol?

        also:i used "+" symbol instead of "$" for connect between strings(you were use "$" in your code but while i test flash file a error occured,so i use "+" for connect between strings.do this solution is correct?)
        thanks

        Comment


          #5
          Use x not *

          Comment


            #6
            Originally posted by Matt Doyle View Post
            Use x not *
            ok,i used x but my problem doesn't solve still.
            so test this command,i use `log function and i put this command into `log function,next in log window i see this context:
            1024A-768f
            so the problem doesn't solve still.
            note:i copied x symbol from microsoft office word and i can not found this symbol from keyboard!
            would you please get me some guidence?
            thanks

            Comment


              #7
              x is the letter x (24th letter) in the English language. The console command you're trying to fire is:

              setres 1280x720

              Comment


                #8
                Press TAB during gameplay.
                Then type in setres 800x600 or setres 1024x768 then press enter.

                For fullscreen:
                setres 800x600f or setres 1024x768f then press enter.

                Comment


                  #9
                  Originally posted by Matt Doyle View Post
                  x is the letter x (24th letter) in the English language. The console command you're trying to fire is:

                  setres 1280x720
                  ok,thanks.
                  an other question:
                  when i set my favorite resolution next i return the before map(that it was made by falsh),i see that around of my map is dark,now i want my mouse(this mouse has made by flash too)doesn't move to the dark part.
                  what should i write in my action script that doesn't let the mouse to move the dark part?
                  thanks.

                  Comment


                    #10
                    Originally posted by fariba View Post
                    ok,thanks.
                    an other question:
                    when i set my favorite resolution next i return the before map(that it was made by falsh),i see that around of my map is dark,now i want my mouse(this mouse has made by flash too)doesn't move to the dark part.
                    what should i write in my action script that doesn't let the mouse to move the dark part?
                    thanks.
                    can you please post a screenshot which shows the problem? I think it might have to do with the Flash not automaticly adjusting to the size of the screen, which is explained in this thread:

                    http://forums.epicgames.com/showthread.php?t=759121

                    Comment

                    Working...
                    X