Jump to content

  • Log In with Google      Sign In   
  • Create Account


stevenmarky

Member Since 03 Jun 2000
Offline Last Active Yesterday, 04:15 PM
-----

Posts I've Made

In Topic: UI auto-adjustment based on available space.

19 February 2014 - 10:45 AM

You're asking difficult questions...you might get more answers if you are able to break it up into separate problems and focus on one at a time.

 

I haven't fully analyzed what you are saying above, and I haven't fully analyzed your code but I have the feeling that you're making an incorrect assumption somewhere. I don't have a specific answer but I have some guesses and some more general advice.

 

the UI is always 1024x768, and I cannot adjust this resolution at run time

 

This sounds strange to me...if you are using Daikon forge and if it is similar to NGUI then when you use a 'fixed size' it's actually just means that it's using a constant 'virtual' pixel height, but the width of the screen is free to change. If so and your problem boils down to converting screen pixels to those 'virtual' pixels all you need to is something like: 

    float pixelPositionToVirtualPosition(float f)
    {
        return f * (virtualScreenHeight/Screen.Height);
    }

This will convert a screen pixel position into a NGUI position, and you can also write a function to do the reverse.

 

When you say something like this:

 

The problem result is that when I have more than enough space for the larger UI, it does not appear

 

or this:

 

I've tried 10-20 different ways of calculating it, including using the whole screen's width and height to determine the aspect ratio and a bunch of other stuff....I'm really out of things to try right now.

 

It makes me think that you're developing using trial and error. If you've thought logically about how the object should be positioned (could help to test the equations on paper first), and it doesn't end up where you think it should then you need to find out why before trying another solution. Use Debug.Log or print statements, or the debugger. Use divide and conquer to find the point at which your code is breaking down, then fix it.


In Topic: Billboard issue in front of 3D object

25 November 2013 - 02:38 PM

With shaders you might be able to change the depth testing offset factor (see http://docs.unity3d.com/Documentation/Components/SL-CullAndDepth.html ) of the scenery to 0 - if I'm understanding the documentation properly this would make the scenery all screen facing in terms of depth, but I'm not sure if it would introduce any other problems.


In Topic: Billboard issue in front of 3D object

25 November 2013 - 11:55 AM

That's an interesting problem.

 

My first thought would be to not use full camera facing billboards, instead use normal quads that are orthogonal to the ground and put the texture on there. You'd still want them to billboard on the y axis however. The side effect of this would be that the sprites would look shortened vertically when viewing from above, so to compensate for that you'd have to stretch the quads vertically dependent on the camera angle. I can't think of any reasons immediately why this wouldn't work, and it seems preferable to messing with shaders.

 

I will elaborate if it's not clear what I'm saying.


In Topic: Haskell kicking my Asskell

24 January 2013 - 04:51 PM

The problem is "post xor mask" on line 7.

 

It should be "xor post mask" because the function comes first (unless it's an infix operator).

 

You can still use it as infix with special syntax:

"post `xor` mask"


In Topic: thanks gamedev.net

02 January 2011 - 12:15 PM

Welcome to gamedev.net!

PARTNERS