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 - edb

Pages: 1 [2] 3
16
Support / Dithered 16Bit_No Alpha - what happens to the alpha?
« on: March 22, 2015, 04:05:49 pm »
I've got Dithered 16Bit_No Alpha as the texture compression on a sprite collection, and as was mentioned in a previous post,
this mode is RGB565, where there are no bits for an alpha channel. 

But check this out - the textures I'm using in that sprite collection do have an alpha channel and the alpha is working - which is awesome to get rgb565 + an alpha channel, but...how is this possible?

17
Thanks for the info!

18
Support / 16 bit Compression options - what compression is going on
« on: March 21, 2015, 11:56:35 pm »
I'm messing around with getting my sprite collections to look good with 16 bit images.  I'm experimenting with different sprite collection
16 bit compression options and am comparing those result with saving out images from TexturePacker using its dithering options
(more info at this post http://forum.unity3d.com/threads/gradient-friendy-dither-options-for-rgba-16-asset-compression.272856/)

What exactly are the compression options Reduced 16 bit, Compressed, Dithered 16 bit Alpha, Dithered 16 bit No Alpha?  And how do they correspond to TexturePacker's settings?

My guesses:
 - Reduced 16 bit-->RGBA4444 linear
 - Dithered 16 bit Alpha-->RGBA4444 FloydSteinberg Alpha
 - Dithered 16 bit No Alpha-->RGBA4444 FloydSteinberg
 - Compressed --> Unity does its normal thing, whatever that is

Am I close?  Thanks!

19
Support / Re: Knowing when a sprite collection was loaded or unloaded
« on: March 07, 2015, 06:15:18 pm »
Thanks for the info.

20
Support / Knowing when a sprite collection was loaded or unloaded
« on: March 05, 2015, 10:18:21 pm »
I'm looking for a way to know when a sprite collection gets loaded or unloaded to/from a scene.  Preferably I'd just like to be able to put a print() statement where the load/unload happens.  Anybody know where?

What I'm actually looking to do is verify that when I leave a scene, a certain sprite collection is getting unloaded, and when the next scene loads, that same sprite collection is getting reloaded again.

I'm going to make that sprite collection persist in memory and I want a way to verify that it's not hitting the hard drive and reloading every time I change scenes.

Thanks!

21
Support / Re: Using wordWrapWidth in code
« on: February 26, 2015, 12:24:48 am »
Thanks for the reply.  I ended up using the native resolution.

For anybody else reading this - I'm making a mobile game and using native resolution width for landscape and native resolution width * aspectRatio for portrait.

22
Support / Using wordWrapWidth in code
« on: February 24, 2015, 08:39:53 pm »
I need to make a textmesh's wordWrapWidth change depending on the width of something else.

I saw this from another post:

"The width parameter refers to the texture space width for the font. If your font is being displayed pixel perfect, it means the width is the number of pixels the where the line is wrapped at. The easiest way to size this is to physically move the widget in the interface. Otherwise, you will need to calculate the pixels you want to wrap at and enter that."

I guess I'm needing help with where I need to "calculate the pixels you want to wrap at".  I know the world, screen and viewpoints of where I want to wrap at, but I don't know how to get those points in terms of the wordWrapWidth.

Thanks!

23
Support / Re: Text Mesh
« on: February 16, 2015, 04:00:03 pm »
I'm using
Code: [Select]
myTk2dTextMesh.renderer.bounds.size.x // for width
myTk2dTextMesh.renderer.bounds.size.y // for height

Also can use
Code: [Select]
myTk2dTextMesh.GetMeshDimensionsForString(theString) // returns a Vector2 with dimensions

24
Support / Re: Zoom to a point when using zoomFactor
« on: February 14, 2015, 07:05:43 pm »
Got it working!  If anybody's curious, here's the bit in my code where the zoom happens:

Code: [Select]
Touch touchZero = Input.GetTouch(0);
Touch touchOne = Input.GetTouch(1);

// A finger was lifted, reset some stuff
if (touchZero.phase == TouchPhase.Ended  ||  touchOne.phase == TouchPhase.Ended)
{
initialPinchCenterHasBeenSet = false;
return;
}


// Find the position in the previous frame of each touch.
Vector2 touchZeroPrevPos = touchZero.position - touchZero.deltaPosition;
Vector2 touchOnePrevPos = touchOne.position - touchOne.deltaPosition;

// Find the magnitude of the vector (the distance) between the touches in each frame.
float prevTouchDeltaMag = (touchZeroPrevPos - touchOnePrevPos).magnitude;
float touchDeltaMag = (touchZero.position - touchOne.position).magnitude;

// Find the difference in the distances between each frame.
float deltaMagnitudeDiff = prevTouchDeltaMag - touchDeltaMag;

// Save the initial pinch points
Vector2 pinchCenterScreenPt = (touchZeroPrevPos + touchOnePrevPos) / 2.0f;
if (initialPinchCenterHasBeenSet == false)
{
initialPinchCenterScreenPt = pinchCenterScreenPt;

// Clamp initialPinchCenterScreenPt to be within the playfield
Vector3 lowerRightCornerScreenPt = gameplayManager.mainTk2dCamera.camera.WorldToScreenPoint(lowerRightMostCornerOfGridcels);
Vector3 upperLeftCornerScreenPt = gameplayManager.mainTk2dCamera.camera.WorldToScreenPoint(upperLeftMostCornerOfGridcels);
initialPinchCenterScreenPt.x = Mathf.Clamp(initialPinchCenterScreenPt.x, upperLeftCornerScreenPt.x, lowerRightCornerScreenPt.x);
initialPinchCenterScreenPt.y = Mathf.Clamp(initialPinchCenterScreenPt.y, lowerRightCornerScreenPt.y, upperLeftCornerScreenPt.y);

                        initialPinchCenterWorldPt = gameplayManager.mainTk2dCamera.camera.ScreenToWorldPoint(initialPinchCenterScreenPt);
initialPinchCenterHasBeenSet = true;

initialCameraScreenPt = gameplayManager.mainTk2dCamera.camera.WorldToScreenPoint(gameplayManager.mainTk2dCamera.transform.position);
                 }



//#### ZOOM PART 1.   ZOOMFACTOR change
float maxZoomFactor = 2.0f;

// Get a zoomFactor by multiplying the pinch distance by a speed
valForPinchZeroToOne = valForPinchZeroToOne - deltaMagnitudeDiff*multitouchPinchZoomSpeed;
valForPinchZeroToOne = Mathf.Clamp(valForPinchZeroToOne, 0, 1);
float valForZoomFactor = Mathf.Lerp(gameplayManager.zoomFactorSave, maxZoomFactor, valForPinchZeroToOne);
gameplayManager.mainTk2dCamera.ZoomFactor = valForZoomFactor;

// CLAMP ZoomFactor
gameplayManager.mainTk2dCamera.ZoomFactor = Mathf.Clamp(gameplayManager.mainTk2dCamera.ZoomFactor, gameplayManager.zoomFactorSave, maxZoomFactor);

gameplayManager.mainTk2dCamera.UpdateCameraMatrix();
//####




//++++ ZOOM PART 2.  MOVE the Tk2dCamera's position.
if ( Mathf.Abs(deltaMagnitudeDiff) > 0) // Only do the move when there was a zoom
{

Vector3 originalOffsetScreen = initialPinchCenterScreenPt - initialCameraScreenPt;
Vector3 curOffsetScreen = mainCamera.WorldToScreenPoint(initialPinchCenterWorldPt) - initialCameraScreenPt;
Vector3 difference = curOffsetScreen-originalOffsetScreen;
Vector3 moveTowardPinchScreenPt = new Vector3();
moveTowardPinchScreenPt = initialCameraScreenPt + difference;

gameplayManager.mainTk2dCamera.transform.position = gameplayManager.mainTk2dCamera.ScreenToWorldPoint(moveTowardPinchScreenPt);
gameplayManager.mainTk2dCamera.UpdateCameraMatrix();
}
//++++



25
Support / Zoom to a point when using zoomFactor
« on: February 12, 2015, 08:01:20 pm »
Anybody have any code or ideas on how to zoom in to a specific point when using tk2dCamera.zoomFactor to zoom?

When you change the value of zoomFactor, it zooms in/out on the position of the camera.
I need it zoom in on a specific point (for doing a pinch zoom on mobile devices).

Thanks.

26
Support / Re: Huge Difference between Android and PC compiled project sizes
« on: February 09, 2015, 11:44:15 pm »
Ok - thanks for the help.  I'll ask around the main Unity forum what others do or if it's even worth caring about.

27
Support / Re: Huge Difference between Android and PC compiled project sizes
« on: February 09, 2015, 10:21:17 pm »
Specifically I'm trying to figure out how to avoid this ->  a 964 KB png in my resources folder is being exported at 8.8 mb, according to the editor.log.

That's a crazy waste of space.  It'll zip up ok for transferring, but that 8.8 mb file will be what sits on a person's hard drive once the game is installed, if I'm following this correctly.

Those SpriteCollection atlases export nice and small...what's the trick?


   

28
Support / Re: Huge Difference between Android and PC compiled project sizes
« on: February 09, 2015, 08:46:59 pm »
Changed the SpriteCollections to png atlases and that took the "sharedassets.assets" sizes way down - thanks!

But - the reources.assets file is still 179 MB.  I have 13 MB of textures in my resources folder and those file are being reported as huge in the editor.log file after I build.

Any ideas on how to make those textures in the resources folder export smaller for standalone?

29
Support / Huge Difference between Android and PC compiled project sizes
« on: February 09, 2015, 04:24:12 pm »
I'm making a cross-platform game (PC and Android) and heavily using Tk2d Sprite Collections with 1x 2x and 4x atlases.

The Android apk compiles to about 46 megs, which is about the size I would expect.
The Standalone project compiles to 800 megs, which is what don't understand.  Why the big difference in sizes?

When I look in the Standalone's compiled directory and in the projectName_Data folder, it seems the main culprit is
the "resources.assets" file, which is 517 megs.  The "sharedassets.assets" files are all really big, too.

Any ideas on what's going on?  Thanks.
 

30
Support / Re: Position sprite differently when in portrait vs. landscape
« on: November 19, 2014, 03:52:04 pm »
Ok - thanks for the quick reply.

Pages: 1 [2] 3