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

Pages: [1] 2
1
Support / Re: Sprite collection doesn't appear in collection editor
« on: July 30, 2016, 02:29:51 pm »
Nevermind, its fixed! :)

Used your solution from here: http://2dtoolkit.com/forum/index.php?topic=2857.0

Thanks for the help!

2
Support / Re: Sprite collection doesn't appear in collection editor
« on: July 16, 2016, 01:45:26 pm »
Sorry for the EXTREMELY late reply, but the problem continues to persist. I'm unsure what you mean by 'check in the meta files', and how this would be done, so I would be grateful if you could explain how to (and if it doesn't work, i'll post my project). The issue arose suddenly (i.e. it didn't occur when i transferred the project or anything), so I wouldn't think it's a setting issue.

Thanks!

3
Support / Sprite collection doesn't appear in collection editor
« on: March 05, 2016, 09:46:13 pm »
Hi,

I think i'm experiencing a bug. When I try to open one of my sprite collections (my only one so far) in the collection editor, the collection editor opens but the sprite collection doesn't open in the collection editor (see attached picture). I assume this is a bug, as it doesn't happen for any other sprite collections I made to test this. Any help would be much appreciated.

Thanks.

4
Support / Re: Mobile Resolutions and Screen Sizes?
« on: August 21, 2014, 08:12:08 pm »
Hi, the screenshots are of the two camera setups and the result. Hopefully they will be sufficient in determining the problem in my setup. I got an error when i tried to upload the attachments. You can find them here instead.
Thanks.

5
Support / Re: Mobile Resolutions and Screen Sizes?
« on: August 20, 2014, 09:57:03 pm »
I tried this and the single colour background from the original tk2d camera is displayed and the custom backgrounds aren't. I have set it up the same way which I posted earlier, with the layer (next to the tag option in the inspector) of the background prefabs set to the background layer and with the 2nd tk2d camera having only the background layer selected in the culling mask and with the initial camera with the background layer deselected. Yet, the background fails to show and the white background from the initial camera is displayed instead. I have tried the inverse (background culling mask only selected on initial camera, background mask deselected on 2nd camera), this time the sprites didn't appear. What have I done wrong? Have I set up the 2nd camera in the wrong way?

6
Support / Re: Mobile Resolutions and Screen Sizes?
« on: August 18, 2014, 12:15:37 pm »
How would you accomplish this? Would you create a background layer, which the backgrounds are assigned to, and on the original tk2d camera with the override would you deselect the background layer on the culling mask option and then create a new tk2d camera without an override with only the background layer selected on the culling mask option?

Also, what exactly does the pixels per meter option mean and do? My option is set by default to 100, is this something that I would ever really need to change? And if so when would I need to change it?

Thanks

7
Support / Re: Mobile Resolutions and Screen Sizes?
« on: August 17, 2014, 01:56:24 pm »
Thanks for your reply. From what I can see in the game view that seems to work. However, I will check it on my device later to confirm it. However, now with the override it scales the background up along with the sprite. Is there anyway to make the background exempt from the override since I am using custom device backgrounds instead?

8
Support / Re: Mobile Resolutions and Screen Sizes?
« on: August 10, 2014, 04:50:56 pm »
Another question, is there a way to make it so that a sprite automatically scale their size, so that they look the same size on any device irrespective of their pixel density. What I mean is if you have a sprite (with 1x,2x and 4x iterations), which is a logo on a splash screen, if you load this on a iPhone 3gs, 4, 5, iPad and iPad Retina, the logo would have different sizes in their real life appearance (i.e. when you use it/ how it appears on their device). Is there anyway to overcome this?

Thanks

9
Support / Re: Mobile Resolutions and Screen Sizes?
« on: August 01, 2014, 01:29:24 pm »
The same as before (with the corrections):
Code: [Select]
using UnityEngine;
using System.Collections;

public class LoadCustomBackground : MonoBehaviour
{
void Awake()
{
Application.targetFrameRate = 60;

if(Screen.width == 480) {
Resources.Load<GameObject>("Background_iPhone");
}
else if(Screen.width == 960) {
Resources.Load<GameObject>("Background_iPhone_4");
}
else if(Screen.width == 1024) {
Resources.Load<GameObject>("Background_iPad");
}
else if(Screen.width == 1136) {
Resources.Load<GameObject>("Background_iPhone_5");
}
else if(Screen.width == 2048) {
Resources.Load<GameObject>("Background_iPad_Retina");
}
Debug.Log("Device data:");
Debug.Log("Screen resolution: " + Screen.width + " x " + Screen.height );
}
}


And I am also getting this error (on an unrelated topic to the script that I posted above):
NullReferenceException: (null)
UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs)
UnityEditor.Editor.GetSerializedObjectInternal ()
UnityEditor.Editor.get_serializedObject ()
UnityEditor.MaterialEditor.OnEnable ()

It doesn't seem to have any effect on the editor, but I only get it when I use sprite collections.

10
Support / Re: Mobile Resolutions and Screen Sizes?
« on: July 31, 2014, 11:02:34 pm »
Ok, I have corrected the custom background script but I can't figure out how I would get it work or how I use it (despite the fact that I wrote some of it!) So I add the script along with the init resolutions script into an empty game object in a initialiser scene. I have the background sprite prefabs in the resource folder. The init scene instantly automatically loads to the first game scene and I should of already loaded the right prefab using the background script. However, how do I get the background sprite to appear? Essentially I am asking how I would get it to work :P I assume the script works fine, but am I missing something out, such as an additional script?  Would it be possible if you could walk me through getting the script set up?

Thanks again! :)

11
Support / Re: Mobile Resolutions and Screen Sizes?
« on: July 28, 2014, 05:01:50 pm »
Thanks, but now i get another error saying that unityengine.screen.width cannot be assigned to (it is read only)? And do you have any advice on automatically loading the right background without running this script in every scene?

12
Support / Re: Mobile Resolutions and Screen Sizes?
« on: July 28, 2014, 02:50:43 pm »
Looks like I edited my last post at the same time you posted your reply! :P Would you be able to have a look at the script I made to help reduce the memory overhead that you mentioned earlier and look at the questions I had about it?
Thanks

13
Support / Re: Mobile Resolutions and Screen Sizes?
« on: July 28, 2014, 02:12:15 pm »
Also, each time I commit a sprite collection I get a pair of errors (attached). They occur on every 2D Toolkit project I have made. Is it a known bug and will it affect my game in anyway?

I also had a shot at coding (it was bound to happen eventually) derived from the code that I found to identify the device through its width.

There is an issue with the <GameObject> part and I get an error saying:
Assets/Scripts/LoadCustomBackground.cs(11,40): error CS1525: Unexpected symbol `<', expecting `identifier'
I am trying to load the prefab sprites that I made for each background. How would I correct this error and are there any other improvements that you would make to the code?

Also, I guess with this code I would have to run it on every scene/level. Do you have any suggestions on how to make it run on the init scene simultaneously with the init script that I posted earlier, so that it would detect what device (and therefore what background sprite prefab to load) in the init scene and would automatically load the respective background for each scene/level automatically? Thanks.

14
Support / Re: Mobile Resolutions and Screen Sizes?
« on: July 28, 2014, 10:41:56 am »
Thanks for all your help so far!
I found this script:
Code: [Select]
using UnityEngine;
using System.Collections;
 
public class Main : MonoBehaviour
{
void Awake()
{
Application.targetFrameRate = 60;
 
if(Screen.width > 1136) {
tk2dSystem.CurrentPlatform = "4x";
}
else if( Screen.width > 480 ) {
tk2dSystem.CurrentPlatform = "2x";
}
else {
tk2dSystem.CurrentPlatform = "1x";
}
Debug.Log("CURRENT PLATFORM (main) : " + tk2dSystem.CurrentPlatform );
Debug.Log("Device data:");
Debug.Log("Screen resolution: " + Screen.width + " x " + Screen.height );
 
Application.LoadLevel("Game");
}
}

Source: https://gist.github.com/AdamDrobotij/10770946#file-2dtoolkit-main

Would you say that this would work to help set and apply the 1x, 2x and 4x textures? I wouldn't know since I am not familiar with programming, but does it look alright to you? Would I simply make an Init game object and give it this script and would it work? (if i change the Application.LoadLevel scene to my own scene).

Nevermind, I just realised it does work! I just made a little mistake while adjusting it.

15
Support / Re: Mobile Resolutions and Screen Sizes?
« on: July 22, 2014, 06:41:26 pm »
Do you know if such a thing could be done with playmaker using their actions instead of through scripting, since I am relatively new to coding?

Pages: [1] 2