Personal suggested Manual notes (use with caution)

0 favourites
  • 14 posts
  • Better documentation is always a good thing. I just want to leave some notes here as I see them

    Mouse: scirra.com/manual/114/mouse

    Set cursor from sprite: An instance of the sprite must exist on the layout where this call is made.

  • Can we amend the documentation, or request it. I occasionally come across things which need some clarity, e.g.

    angle(x1, y1, x2, y2) Calculate angle between two points

    doesn't actually specify which way round it is, is it the angle from x1 to x2 or x2 to x1 ?

  • would love to see more examples as well, on how to use the specific functions etc, it would greatly help to take advantage of a great tool

  • breflabb: How do I FAQ ?

  • Kyatric thank you so much ! i wonder how i have missed this treashure trow!

  • Create Object: At the time of object creation, it doesn't have a height or width. Using a sprite's size is not effective when creating it relative to other objects.

  • Create Object: At the time of object creation, it doesn't have a height or width.

    That's absolutely untrue. It uses the height and width of the first instance created in your project.

    EDIT: The object type does have a width and height and creating an instance of that object type on any layout does create the instance with the expected width and height.

    The initial instance of the project does not actually play into effect in this.

    Using a sprite's size is not effective when creating it relative to other objects.

    You are trying to create several object types in the same tick and are facing the fact that actual instances are only created on the next tick.

    https://www.scirra.com/forum/viewtopic.php?t=73647&start=0#352637

  • > Create Object: At the time of object creation, it doesn't have a height or width.

    >

    That's absolutely untrue. It uses the height and width of the first instance created in your project.

    The object must need to exist on the layout in question, not merely in the project.

    The game idea I'm working on relies on a relatively simple layout that grows increasing more complex over time. Unfortunately this seems to create a lot of quirks, like sprite height not having a value because all of the assets are "preloaded" on a second, unused layout.

  • Containers: Families cannot be part of a container. If all family members require an object, that object needs to be created and picked manually (often through an family instance variable).

  • The object must need to exist on the layout in question, not merely in the project.

    Still not exactly true and pretty confusing.

    An object type exists throughout the whole project.

    You can use the create action to create an instance of it in any layout, even in a layout that is different from the layout containing its initial instance.

    If what you mean is that you are having a blank layout (that currently contains no instances of any object type), but your project contains a SpriteA object type and a SpriteB object type that both have initial instances on another layout and in your blank layout you are using the create action to make a new instance of the SpriteA object type for example, and directly setting its width to be equal to SpriteB's width, obviously this won't work, since your layout does not contain any instances of the SpriteB. This is pretty normal related to how picking works though.

    The vocabulary you are using talking about object instead of instances is what makes your annotations confusing and slightly untrue.

  • Kyatric

    The specific block I was trying to do (I've since amended it):

    Create object "Hero3" on layer "UI2" at (ScrollboxList.x, ScrollboxList.y + Hero3.Height/2 + UIMARGIN) on Layout 1.

    I have a copy of "Hero3" on Layout 2, but the sprite still gets fixed mostly at the top of the list (ScrollboxList has the origin set to the top middle) instead of wholly enclosed within ScrollboxList as expected, suggesting that Hero3.Height = 0. I since replaced it with a flat number. This is only a problem for the first item in the list because I then use an instance variable ScrollboxList.CurrentElementY += Hero3.Y + Hero3.Height and that replaces my create Y coord. This works so long as all of my Heroes are the same height.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Still prefer to post in the how do I to get confirmation first and providing your capx to just making sure you are having a correct and efficient implementation.

    From the description you just did, I did not understand what you are trying to achieve and what you are actually doing, it is easier to see an actual project and preview it for those kind of things.

  • Okay, since you wanted a demonstration:

    https://dl.dropboxusercontent.com/u/552 ... yDemo.capx

    Sprite 2 exists and I can reference it's height/width just fine. Sprite 1 only exists in Layout 2, so when I create it in Layout 1 it's Height is 0 at the time of creation.

    This is the kind of stuff that needs to be better documented. This is not a "personal" suggestion, but something I would add to in a wiki, nor does it need to be used with caution. It's simply providing information about what I can and cannot do in the engine, not a suggestion.

    Just like the mouse cursor: Placing the mouse sprite in layout 2 is not enough if I wish to set the cursor to that sprite in layout 1.

    Ultimately my goal is to create a scrollable list populated with sprites. I've done it in events. It's a bit messy, but I think I have the execution mostly done. For optimization, I think I may have better results keeping a copy of every object and moving them instead of creating/destroying.

  • Again, what you are referencing is a picking issue.

    The object type does exists in the project and is accessible. But on your actual layout there is no actual instance.

    Best way to understand it, add a "Wait 0 action" and copy the create action under it.

    Now you have two instances of Sprite in your layout and the second instance is positioned where you expect it.

    Because the second "Create" action DOES have an instance to reference (which the first does not).

    You are talking about clearer documentation, yet, and reread my previous messages that's what I've said all along, you're not using the correct vocabulary.

    You are talking about object (in C2's vocabulary object type) when it's all about instances.

    I'll amend the fact that indeed, the initial instance in the whole project is not "used", you need to have an instance in the current layout to reference it the way you are wanting to.

    But again, and in regards to how picking works, it's only logical.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)