Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Intrawebs

Pages: [1] 2
1
Support / SpriteCollection Editor Polygon Collider questions
« on: April 11, 2016, 05:37:19 am »
I can't seem to find documentation on what these three items below are and when/why I should use them?

Collider Type = none, front & back, font, back
Convex = true/false
SmoothSpehereCollision = true/false


I'm creating a top down arena game would like to use polygon colliders for my sprites, which is fine, just want to know if I should be messing with these options above.

2
Support / Re: Convert tk2dCamera ortho to 3D
« on: August 01, 2014, 07:16:40 pm »
Will do!  Thanks

3
Support / Convert tk2dCamera ortho to 3D
« on: August 01, 2014, 05:58:16 pm »
I currently use 1x,2x and 4x sprites and have a game working great in multiple portrait resolutions for Android.  I now want some of my graphics to be 3D.  What is the recommended approach?  I develop at 320x480, my camera settings are attached.  I tried some quick monkeying with setting the camera to perspective but then changing resolutions didn't pan out well.



4
Support / Re: Convert desired runtime width to scale
« on: January 28, 2013, 04:28:33 pm »
DOH!  Of course I can duplicate it, dont know why I didn't think of that.  I'll also try the other suggestion.  Thanks.

5
Support / Convert desired runtime width to scale
« on: January 28, 2013, 08:35:10 am »
I have a header graphic with rounded corners on either side and text in the middle.  The graphic also has a background behind the text.  The size of the text is dynamic.  So thats 4 sprites (left, center, right, text).  I already have code running that sets up the positioning of all of these and I know exactly how long I need the middle background graphic to be.  That graphic is a tiling graphic, so I need to scale it on the x to fit the width of the text.  Is there a way to do this, a way to convert the known and desired width of the graphic and have it scale?

You can see what Im trying to do here
http://i.imgur.com/9Yi9MM2.png

6
One more question on this, should I still be doing anchor middle center on my sprites in my sprite collection (2x, 4x) with the new override setup you suggested?   Or do you think I should anchor my sprites differently?

7
Thanks, this all works great now.  Pixel Perfect Fit works as well.  :)  You may want to sticky the part about getting multiresolution support with the override you suggested.

8
As I was typing the below you posted, so I will reply to your post.  Correct, my issue was needing to move some stuff around, but the root problem was actually my latest question which was related to my original post of not grasping all this.  Once I get this root issue fixed then moving stuff around should work fine per what you already suggested on that.  Per your recent post, that seems to work great.  But, I dont see the option for "Pixel Perfect Fit" in the camera override, I just downloaded the current version from the asset store as well to double check it wasn't a version issue.  I do see a "stretch to fit".

Below is what I was going to do before you posted your response.  Looks like I dont need to set scale and do what you suggested and then separately pick which asset 2x vs. 4x to load on my own, not a problem.  Thanks for all your help on this!




******************************
I think I now know how to approach this.  I will at game load time, the same time I set 4x vs. 2x also create and have only 1 resolution override.

This override will be...
width = screen.width
height = screen.height
auto scale = none
scale = screen.height / NativeRes.height (see psuedo code below)
fit mode = center

While testing the above logic by manually setting these on the camera this works, everything gets positioned properly.  What I'll be doing is essentially creating 1 wildcard at runtime that is actually meant for the active resolution.  Of course I need to also make sure that when Im setting the scale to also set a matching 4x vs. 2x, which would have impact on the scale.


Some pseudo/hack code here on handling the decision making for 4x vs. 2x and its impact on scale to make sure the best possible scale and source is rendered.

scale = 1
tk2dSystem.CurrentPlatform = "2x"

tempScale = screen.height / 2k2dCamera.NativeRes.height
if tempScale >= 1.5
  tk2dSystem.CurrentPlatform = "4x"
  tempScale = screen.height / (2k2dCamera.NativeRes.height  * 2)
  scale = tempScale ///// here we are scaling down the 4x vs. scaling up the 2x.....need to play with the results to see what looks optimal and when (scale up/down 4x/2x)
else if templScale > 1 AND tempscale < 1.5
  scale = tempScale  /////scale up the 2x...but no more than 1.5 times its original
else if tempScale < 1
  scale = tempScale ////scale down the 2x

//I could then also check if the scale <  .5 and show a 1x vs. the native what I used to design of 2x...I doubt I will ever have a height of < 480

 

9
Your suggestion still doesnt help when scaling. 

Im confused as hell now and have spent a lot of time on this.  I want to get this right before I go any further on my project.  I think it would be great if you had a demo scene that handles the following.

My goal is to have containers centered top, centered bottom and centered middle.  The game is played in portrait.  My sprite collections will have 2x and 4x sources....or 1,2 and 4x if it makes sense.  I want everything to auto scale per resolution and want to design at 640x960.  I have a background tiled sprite that is massive, so letter boxing on the sides is not an issue as this tiled sprite is shown.  My 4x sources are all 2 times the size as the 2x source...per your doc this will have the best results.

How should i setup the camera when doing this, I do not want to put in explicit width and height overrides for every possible size as this will be on Android.

10
How do you advise I solve this problem then.  I need to get the center of the screen with scaling so that I can position objects in their same position but exactly 1 screen to the left or right of the visible screen.

I tried...

Code: [Select]
var centerScreen = tk2dCamera.inst.ScaledResolution / 2;
Center = new Vector3(centerScreen.x, centerScreen.y, 0);

//this is one virtual screen space to the left...not visible
var xPos = Center.x - (centerScreen.x * 2);
screenLeftPos = new Vector3(xPos, Center.y, Center.z);

//this is one virtual screen space to the right...not visible
xPos = Center.x + (centerScreen.x * 2);
screenRightPos = new Vector3(xPos, Center.y, Center.z);

But, the ScaledResolution =400x400 for some reason when an override is set to scale at .5 (with a resolution of 320x480) from the native resolution on the camera of 640 width and 960 height, so I dont understand how it got 400x400.
http://imgur.com/ImjFhlf

11
Its the camera anchor transform position.  I set one up as middle center while at 640x960.  When I run the game and change the resolution to 320x480 the anchor (and all others) stay in the same place.  The anchors move to their respective positions at different resolutions when there is no override for that resolution.

12
I develop at 640x960 (so I can see what Im doing) per my original post I still use the same assets.  The problem I have is when I switch to 320x480.  I have an override on the camera set to scale of .5 just like in your demo #11.  I do this so that my 2x atlas can be used for both 640 and 320 widths (if there is a better approach to this let me know).  The problem is, the anchors dont adjust their position automatically because of the scaling override I think, they do adjust when there is no override scaling. 

The graphics do scale and look just fine and in the place they are suppose to be, but Im using some anchors as reference points to do some tweening of objects.  What do you advise for the most seamless workflow.  I know you say develop at the lowest resolution I intend to support but I think I would still have this problem in situations where I need to scale up. 

A simple alternative is to do screenWidth/2 and screenHeight/2 to get middle center vs. using anchors as reference positions. 

13
Thanks for helping with my sanity check!  Haven't tried the phone yet, need to grab some old ipods around the house and try them (4th and 2nd gens), looks great when forcing the editor to those lower resolutions.

What has been your experience or others when needing to futz with overrides? As in when do you commonly need to if at all?

14
I'm using your TK 2d Camera, I also have two sprite collections that both have a 2x as their current platform and a 4x as an additional platform.  The atlas's all get created just fine.  For the camera I have it setup pretty much like you did and I work at the 640 width x 960 height with my 2x sprites all designed/anchored/positioned just great at that resolution in the editor.  My 4x sprites are all double the size of the 2x sprites and are designed to be full retina on ipad4 (2048 height x 1156).

I then fire up my iPad 2 (1024 height x 768 width).  In the scene before my gameplay I do the following
tk2dSystem.CurrentPlatform = "4x"

The gameplay screen has everything automagically positioned, scaled etc on ipad2.  It looks as if my 4x atlas is used and scaled down 50% (what I want).

What I dont under stand is the camera overrides. Are they needed and when would I use them?  Am I doing anything wrong?

Also, do you have any links in these forums about how people tackled android ratios/resolutions while also using the TK2dCamera?  I purchased multiplatform toolkit asset but so far I haven't needed it.

15
Support / Re: Backwards compatibility with Unity 3.4 and below.
« on: March 02, 2012, 12:21:19 am »
I just installed today (your plugin) after my Unity upgrade from 3.4 to 3.5.  Im all set.  I've seen some peeps rolling back to 3.4 in the Unity forums, but it was mainly on very large multi GB projects and some advanced shader issues, so Im not worried with 2d.

Pages: [1] 2