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.


Topics - mygamingproject

Pages: [1]
1
Support / Tilemap positioning
« on: April 26, 2015, 08:11:42 pm »
I had a couple of tilemaps positioned and working fine in a released ios game but something odd has happened which I dont know is coincidence to a Unity 5 / Xcode 6.3 upgrade.

Its now the case that the Unity Editor shows everything fine but when viewed on device the tilemap will appear in the bottom right with only the top left 20% showing.  The rest of the screen shows a pink (non asset) area.

Any ideas as this has been baffled as I have not changed anything to my knowledge.

2
Support / Centralising prefabs
« on: December 27, 2014, 09:49:25 am »
I'm creating a 9x9 grid (think Match3 genre) and use a tile/square as a prefab which has all its characteristics. 

I generate columns and rows and then add prefabs to scene at runtime.

However, I want the alignment to be centralised to the screen for the purposes of resolution but not sure what the best way is to offset.  Do I add my tiles to a parent gameobject and centralise that GO to screen? Or do I work out the minus offset for x and y and start my tile building appropriately so 4.5 tile is the central position?

I kind of have the latter working but seems suboptimal.

3
Support / tk2duiitem - gameobject sender
« on: October 25, 2014, 11:40:19 am »
I have read through the forums and tutorials and struggling to get the sender gameobject on button click.

I have a prefab button that is instantiated.  There is a button controller which is the target of the tk2duiitem with the OnClick event being the following method

Code: [Select]
public void LoadGameClicked()
{
Debug.Log ("Load Game Clicked");
}

Which works fine

However if I want to access the parent GameObject so I can interrogate various parameters, classes etc on what to do next I'm not sure how to interpret the message.

For example,

Code: [Select]
public void LoadGameClicked(GameObject obj)
{
Debug.Log ("Load Game Clicked");
}

Errors with

MissingMethodException: The best match for method LoadGameClicked has some invalid parameter.

System.MonoType.InvokeMember (System.String name, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object target, System.Object[] args, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, System.String[] namedParameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/MonoType.cs:520)
UnityEngine.SetupCoroutine.InvokeMember (System.Object behaviour, System.String name, System.Object variable)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
tk2dUIItem:DoSendMessage(String) (at Assets/TK2DROOT/tk2dUI/Code/Core/tk2dUIItem.cs:246)
tk2dUIItem:Release() (at Assets/TK2DROOT/tk2dUI/Code/Core/tk2dUIItem.cs:266)
tk2dUIManager:CheckInputs() (at Assets/TK2DROOT/tk2dUI/Code/Core/tk2dUIManager.cs:443)
tk2dUIManager:Update() (at Assets/TK2DROOT/tk2dUI/Code/Core/tk2dUIManager.cs:321)

How do I get hold of the gameobject, any assistance would be greatly appreciated?

4
Support / Switching TileMaps
« on: September 02, 2014, 08:57:18 pm »
I have a gamescene which has a tilemap,  all working nicely for 3 levels.

However, I have added a new level within the same gamescene but the tilemap is slightly different. I don't want to duplicate the gamescene for the sake of about 30% of the tiles so is there a way of hiding a tilemap and showing another?  There is no renderer attached to a tilemap so that isnt a default option which made my think because of this it wasnt the right route to take.

What would you suggest?

5
Support / Colliders on screen / camera edge
« on: August 27, 2014, 10:20:56 am »
I want to have it so that the screen edge is the limit of movement.  Coding this is straightforward but physics is involved so dont really want to be doing messy inverse forces to imply boundary checks.

What I was thinking was applying a "soft" material box collider to the left and right sides of the camera view but then thought about the issue of different screen resolutions widths i.e. iphone5 over iphone4 for example. 

Is it possible to anchor a box collider on either side but out of view to achieve this effect.  If so how is best to accomplish it?

6
Support / Programmatically positioning within camera view
« on: August 24, 2014, 11:31:01 am »
I think I am probably making this difficult for myself but I simply want to spawn a prefab in a position that is always within the camera view.

The issue I think I am having is I'm confusing pixels with Screen points in my positioning so some appear and some others don't but nonetheless can't work it out.

Any assistance would be appreciated.

7
Support / Instantiate tk2dSprite loses tag
« on: August 16, 2014, 10:11:33 am »
I have a tk2dSprite (a laser) that I have create as a prefab. There are four lasers positioned in opposites corners of a rectangle firing in.

I used a Rigidbody2d to push with force and isTrigger to detect on collision with the player.  This bit works well.

The problem is when they pass the player and the the lasers collide.  I have removed the laser collision from the physics matrix yet still they collide.

So I tested the layer to see what was return and see the instantiated object (the laser) is marked as "Untagged" and not "Laser" as is in the prefab.

Here is my calling code:

Code: [Select]
GameObject laser = Instantiate(Resources.Load("Prefabs/Laser")) as GameObject;
laser.transform.position = turret.transform.position;
laser.transform.rotation = turret.transform.rotation;
laser.transform.Rotate(0, 0, tempAngle);


I have even tried adding the tag in again

Code: [Select]
laser.tag = "Laser";

But no joy, any ideas?

8
Support / Polygon collider and isTrigger
« on: August 13, 2014, 08:08:38 pm »
I have followed these steps http://2dtoolkit.com/docs/latest/tutorial/creating_polygon_colliders.html for creating a polygon collider within the spritecollection but how do you make it isTrigger = true when the collider doesn't appear within the prefab?

9
Support / Help needed with cross platform spritecollections
« on: August 03, 2014, 10:26:55 am »
I'm struggling to get the cross platform (1x, 2x and 4x) spritecollections working.

I have included a project (https://bitbucket.org/mygamingproject/displaycheck or download at https://bitbucket.org/mygamingproject/displaycheck/get/54ea635e3900.zip) to hopefully show the issues I am having.

I'm targeting mobile and ios5.1 so I see my three derivatives being

1x = iphone 4 (960 x 640)
4x = iPad Air (2048 x 1536)
2x = everthing else

To demonstrate the issue i am having i have used some open game art by evo (http://opengameart.org/content/2d-adventure-sprite).

The alien in this art will be the height

1x = 90px
2x = 180px
4x = 360px

Meaning the alien should consume somewhere between 15 - 23% of the height of the screen assuming in landscape.

I have a singleton that sit within a scene called "setup" that sets an object then persists throughout my scene as well as determining the ratios. This seems to be called correctly.

The issue I think i am having is the correct setup of the camera to sprite. If I setup my sprite to accommodate the alien, I click on the 1:1 button to ensure its pixel perfect and the scale drops to 0.05. The only way is remedy this is to zoom the camera scale or alter the scale of the sprite but this then doesn't work correctly with the resolutions.

The camera is prettyy standard setup as well

Native and Preview Resolution at 960 x 640 (my lowest and 1x supported resolution)
Pixels per Meter set to 20
Origin set to 1

Overrides set to

Matchby: Wildcard
Auto Scale: Fit to Height
Fit Mode: Center

I don't understand if the alien is 360px and height is 1536px the scale at 1:1 can be 0.05.  Particularly when the camera and the imported assets have been imported at the same units.

Any help would be appreciated as currently I can't ignore this issue as the texturememory falls over on lesser devices if I just go with one.

10
Support / SpriteCollection on build
« on: August 02, 2014, 07:56:36 am »
When building does only the assets in the SpriteCollection get taken over to the build or all images assets in the project?

11
Support / Issue with spritesheets
« on: July 31, 2014, 10:48:11 pm »
I'm importing a spritesheet that I want to add to a sprite collection.

The optimisation of the spritesheet is significant performance boost so need to get this working.

All is fine and the spritesheet is imported with the following texture properties http://imgur.com/S6JGgZb

I then go to create my spritecollection but it doesnt recognise the spritesheet and gives me the error:

Asset import did not unload metadata path. This will leak memory.

I'm following these steps http://www.unikronsoftware.com/2dtoolkit/docs/latest/tutorial/importing_a_spritesheet.html and the sprite colleciton recognise the spritesheet but not the individual assets within the Unity spritesheet.

I really don't want to just use Unity2D so what am I missing?

12
Support / Help needed with Camera overrides
« on: July 13, 2014, 09:31:59 pm »
I am having issues with getting the camera overrides to work.

I have created the following:

- Setup Sprite collections with platform specific content for 1x, 2x and 4x
- Setup a camera and native state to be that of an iPad 3 - 4x Pixel Perfect
- Created a scene before anything else happens to determine the resolution and set the CurrentPlatform appropriately.  Its done in a separate scene to avoid any draw calls
Code: [Select]
public class ResolutionSetting : MonoBehaviour
{
void Awake ()
{
if(Screen.height <= 320)
tk2dSystem.CurrentPlatform = "1x";
else if(Screen.height <= 770)
tk2dSystem.CurrentPlatform = "2x";
else
tk2dSystem.CurrentPlatform = "4x";

Application.LoadLevel("Scene");
}
}
- I've created Overrides to the cameras for each of the iDevice resolutions (http://imgur.com/wzFBTKi)

The issue I am having is that the camera isnt being set when changing the Editor iOS prefixes.  The platform is changing but the overrides aren't/

I can't call it from my script as the camera resides in the other scene and even if I put to the game scene the awake call would be executed before the camera created.

When viewed in editor the camera doesn't change.  What am I doing wrong?

13
Support / Spritesheets to import
« on: July 13, 2014, 01:40:22 pm »
Ive read http://2dtoolkit.com/forum/index.php/topic,1636.0.html and can't say I fully understand it.

I have also read http://www.unikronsoftware.com/2dtoolkit/docs/latest/html/classtk2d_sprite_collection_data.html#aa2297da8bece8c3b6047e838cc4cb261 but if I go the runtime route I guess this is best for establishing spawnable enemies etc rather than fundamentals like menu buttons, backgrounds etc which would be candidates for sprite batching.

Then comes the further complication of multiple resolutions where the right texture needs to be assigned and used.

I have over 100 images so importing into a spritesheet first is far more convenient that having to rename and resize every image 3 times for x1, x2, x4 and then use Platform Support on the sprite collection. 

What is the best way of achieving this as I can't be the first person to be askin but not finding an answer other than a very manual approach of individual assets that bypass any external convenient tools.

14
Support / Collisions with Animator
« on: July 12, 2014, 09:07:22 pm »
I have a Sprite with animator that I have applied a box collider 2d to.  I haven't setup colliders for each frame as assume a collider to the animator is possible.

I have setup a game object with a box collider 2d as a boundary and it just doesn't collide, just passes through each other.

Is it not possible to add a collider to the animator but instead have to do it for each frame of animation?

15
Support / Sprite animations
« on: June 15, 2014, 09:34:54 pm »
Are sprite animations independent of sprite collections? So if I have a 1x 2x and 4x for different resolutions are sprite animations intelligent enough to pull in the correct one based on resolution identified. Or do I need a different animation per sprite collection like how Unity2D currently handles things?

Your advice would be much appreciated.

Pages: [1]