immortalx's Recent Forum Activity

  • OK it seems I found something:

    Firstly, It seems that if the collision poly is set to bounding box, the first point is bottom-left and the rest are in a clockwise fashion.

    With the following code I was able to calculate the new collision poly:

    this.type.animations[0].frames[0].poly_pts[0]= -hx/this.width

    this.type.animations[0].frames[0].poly_pts[2]= -hx/this.width

    this.type.animations[0].frames[0].poly_pts[4]= 1-(hx/this.width)

    this.type.animations[0].frames[0].poly_pts[6]= 1-(hx/this.width)

    this.type.animations[0].frames[0].poly_pts[1]= 1-(hy/this.height)

    this.type.animations[0].frames[0].poly_pts[3]= -hy/this.height

    this.type.animations[0].frames[0].poly_pts[5]= -hy/this.height

    this.type.animations[0].frames[0].poly_pts[7]= 1-(hy/this.height)

    Now the problem is that it's not instantly updated. It's only when you perform a scale or rotation operation that it "snaps" into its proper position.

    Updated plugin and CAPX:

    https://dl.dropboxusercontent.com/u/14855413/c2/originatruntime2/sprite.rar

    https://dl.dropboxusercontent.com/u/14855413/c2/originatruntime2/hotspot1.capx

    If you try it out, first enter some new values for x,y origin and then use right click to rotate and middle click to scale.

    Please if someone can share his thoughts or can find why the poly is updated only after a rotation/scale operation I would really appreciate it.

  • R0J0hound

    I will try to figure out what those values mean. I already called update_bbox() and set_bbox_changed(), it's just the collision poly points that don't get updated and I suppose I'll have to find a way to shift them manually.

    Once more thank you for your time!

  • R0J0hound thank you very much!

    I took a look at this excellent plugin and if I understand right, the setOrigin action offsets the polygon vertices?

    What I'm aiming for is exactly how the Construct 2 editor works: When you change the origin of a sprite inside the editor, the origin stays at the current x and y and it's just the texture that "jumps" to an offset position. In the polygon plugin that doesn't seem to be the case.

    However, I found a line of code inside the plugin that seems to do what I want but i can't figure out what values to pass:

    this.collision_poly = new cr.CollisionPoly(new Array(0,0,0,0,0,0,0,0));

    It seems these are pairs of x,y values for each point in the collision poly, starting from top-left and going in a clockwise fashion? I can't understand if these are local or world coordinates.

    Thanks in advance.

  • rexrainbow

    R0J0hound

    Ruskul

    newt

    Sorry for tagging you guys (i'm sure I forget others too), but I would greatly appreciate if you can take a look at this and give me some guidelines.

  • Hey guys.

    First of all I know little about programming (let alone javascript), but I really needed this functionality in the sprite plugin.

    So i fiddled around with the SDK and added 2 actions in the sprite plugin. To my surprise, it seems to work. The problem is that the collision poly doesn't get updated and I would really need some help from the gurus here!

    Please backup the official sprite plugin before trying this.

    https://dl.dropboxusercontent.com/u/14855413/c2/origruntime/sprite.rar

    capx:

    https://dl.dropboxusercontent.com/u/14855413/c2/origruntime/hotspot1.capx

  • Tom I think there's a bug in the forum, nothing major but i thought I'd let you know:

    There seems to be a deleted topic that stills shows on the main forum page, as the most recently updated topic of the game discussions section.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well this is odd. Both Chrome and Firefox show poor images. IE renders ok and NWJS 10.5 ( based on an earlier chrome) renders fine. So its nothing to do with Alpha 6. I have the latest Nvidia drivers and i have tried earlier versions to no avail.

    Seems something has changed on my PC.

    I know it sounds like standard staff to do but definitely re-install the driver. I'm running the latest Nvidia driver myself and all of a sudden NW.js preview was rendering everything with a strange tint. Since IE, Chrome and Firefox was fine, I thought the driver should be OK, but I was wrong. A re-install fixed my issue.

    Just do it to rule out it's not a driver thing.

  • Really like your art style and it's such a nice concept. It kinda reminded me of Jack the Nipper, an awesome 80s game!

  • TechnoBeaver thanks man! I'm trying to keep it as simple as possible. I plan to add a feature where you could assign parent/child relationships to objects. That would make easier to animate I believe.

  • ^ That sounds nice to have.

    For notes I personally create a blank sheet, put a comment in there and write down TODOs, bugs, variable states, etc. Using Shift+Enter to make it multi-line, it works perfectly.

  • Hey guys, this is what I've been working on for a month or so in my spare time. This will (hopefully) become a little Windows app for simple 2D keyframe animation.

    For C2 veterans this would probably take a couple of days to code, but for me it's quite hard!

    It's in a very early stage but I thought I'd share it. You can move things around and record keyframes. There's no undo, no bones, no multi-selection, no save/load and it's certainly buggy

    How to use:

    Click File->Import sprites and point to a folder with PNG images. NOTE: It doesn't check for correct file type, so make sure there are only PNGs in the folder and nothing else.

    Setup the first pose in frame zero and adjust pivot points.

    Move to another frame, setup another pose, click create key, etc.

    You can adjust z-order but it's not "animate-able".

    Mouse wheel to zoom in/out, middle mouse to pan.

    Move and scale manipulators: Drag from center-->both axes. Drag red or green part-->constrain to a single axis.

    Hoping to fix bugs and add more features soon.

    https://dl.dropboxusercontent.com/u/14855413/c2/ani.rar

  • Well, happy birthday to you my friend!

immortalx's avatar

immortalx

Member since 8 Sep, 2013

None one is following immortalx yet!

Connect with immortalx

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies