Lost my Keys's Recent Forum Activity

  • Crazy thought:

    Would it be possible to make a fake edit box, which isn't actually an edit box. By that I mean have the real edit box but hidden somewhere, then once you give focus to the fake edit box, it's actually giving focus to the real and hidden edit box. Then have the fake one output whatever is written in the real edit box. That way the fake one would sit nicely under your custom cursor while the offending real one will be hidden and not getting in the way, but you'll still be basically using it, which if anything else in your game NEEDS the real thing available to work correctly, will continue to work correctly.

    There's probably a far easier way of solving it than that, but I haven't had my morning coffee yet

  • Example

    There you go, from what I can tell it does what you're wanting to do.

  • ...I... yeah... Get Text Width and Get Text Height are REAL things that you can get info for by double-clicking on a text object when you wanna do something like, say, change an object's width and height to match that. In the event editor, it appears as [object].TextWidth(Text) or [object].TextHeight(Text) and what I'm saying is that that doesn't work. It's recognizable by the editor, and even when you do the double-clicking thing and select the option "Get Text Width", that shows up even in the newer versions, but it doesn't work.

    I still have no idea what you're talking about the canvas object for... o_O

    The canvas object was used as an example only, of something that wasn't working but now is, and anything using parts of it, oh whats the point i'm just repeating myself, lol!

  • Have something spawn the object at the position you want, using the method you want, then destroy itself (use an invisible sprite somewhere), then if for example you want to be able to spawn another bullet once the first one is eventually destroyed, just have the invisible spawn sprite respawned on the bullets death. That should work?

  • Ok, unless it's PHP or mySQL related, I can't program worth shit. I've tried to learn how to create shaders, read tutorial after tutorial but it just ain't happening, they all seem to miss out the actual part where you want the shader to do something and instead focus on setting it up. Yeah no good.

    So I'm making this request for someone to write an .fx shader for construct, using the following guidelines and information. It does nothing that shouldn't already be possible within the program, and even uses some known limitations to its advantage.

    For someone experienced in writing .fx shaders, it should be childsplay. For someone like me, it's up there with reading C++ for dummies over the weekend and then writing an MMORPG from scratch - not gonna end well.

    Credit and stuff like that, you wrote it, you get all the credit. I've just made this request is all, and really want to see one done, as I do have a great need for it lol. So anyone who cares about getting credit where it's due, don't worry on that score. Sell it as your idea afterwards and make millions all to yourself, lol.

    Since a simplified version of this shader requires no depth, or 3D. I think it could work.

    What it does/should do

    Think of it (in this sense) as a self contained miniature parallax effect, because essentially that's what it is. But it must only work on the layer it's on, ignoring transparent area's of the layer (as is my understanding from what Ashley has said, a shader will not effect anything beyond their bounding box, which is perfect for this).

    You have your image, for example a brick wall. This is the colorful pretty image the player sees. Above that you have a bog standard height map, black is the lowest point, white is the highest point, again nothing spectacular or never done before in construct. Set that one up to always follow the position of the brick wall.

    The shader would then be applied to the height-map image, like with other available shaders. For it to work correctly, you would then have to tell it via an event, where the center point's X and Y is located in relation to the display window as well as the "imagined" depth of the height map.

    This is where the fun begins - as the sprite moves away from the center point, the shader uses the grayscale height-map to push, drag and pull on the pixels below it. Each shade of gray moving slightly slower than the value above it. With the white 255,255,255 pixels moving the fastest, while the black ones don't move at all. This then in turn causes some pixels to be squashed (vanish to the eye) while others are stretched. If used carefully, this gives the impression of thinking you can see more of one side than the other.

    Yeah, it's a down right dirty cheap trick, but it can work really well if it's not abused. Not only would you have your regular layers moving at different speeds with a nice parallax effect, but your chosen objects would also appear to have a kind of depth to them also.

    Event Options

    Besides the usual on/off options, the shader should have the following available:

    Center point X

    Center point Y

    These two options above tell the shader where the optimum point is for viewing the image with no distortion. Generally this would be the exact center of the display screen, but in many cases you might want it to follow the Y level of the player, or even control it by the mouse.

    Depth Z

    No, this isn't asking for depth in a 2D world. What this would do is basically tell the shader how fast to distort the white pixels in relation to the other shades of gray. A larger Depth Z would result in a faster distortion as the object moved away or toward the center point, while a lower depth would result in a more subtle distortion. Unfortunately I can't do the math for this bit, would be something like "move X pixels Y distance for every Z pixels away from the center point" ? I think, yeah something like that.

    Limitations

    The user would have to fine tune the shader to their game, as screen size and sprite size would have a big part to play in getting it right. What depth Z setting would work for one game, could look terrible for another. Remember, the pixels are just being stretched and shrunk, so eventually at a certain distance, the entire sprites texture will be stretched beyond recognition by the shader.. Obviously you want this to happen off screen, so the player can't see it.

    It wont make everything 3D, it's still a 2D trick and is only capable of creating a subtle effect which would be ruined by overdoing it (such as increasing the depth too high in the attempt to try make something look 3D). It'll break and result in badly stretched underlying sprite textures if the depth is too high. A rule of thumb would be the perceived distance between the pure black area's and the pure white area's should not be too great. Walls, deep surface textures etc. are fine, views from above a city with tall buildings are not.

    It could bugger up collision detection in some cases (unless using containers and another object as the collision box), and IMO should just be used on background tiles and sprites for best effect.

    It probably wont work on lower DirectX pixel shader versions. But as it's nothing more than a visual effect and not related to gameplay, I don't see that as a concern.

    Like with using normal maps or shaders in general, it does practically double everything it's being used for. Though because the effect doesn't have to be pixel perfect, you can get away with using height-maps that are half or three quarters smaller than your sprites texture and still get a good result.

    -

    I'll note that it is similar to the sprite's distort options, however I've had little luck in finding useful tips on using distort maps, especially for creating something like this, and a shader would just do it all much more easily, at least that is my understanding of distort maps.. unless someone wants to make a cap doing exactly what my request for a shader would do *hint hint* lol. Though bare in mind, this shader effect would be usable on many, many, many different sprites of different shapes and sizes and appearance. Could a distort map also be used in such a way too, without it taking forever to create. While distort maps have their uses, I think this would be something best left to the proposed shader effect.

  • I'm... not sure what the canvas object has to do with anything... o_O

    [quote:3mqe0tok]I noticed on the newest update, where it mentions part of the canvas being fixed, that anything using those parts of the object from before, need to be redone. Have you tried doing that in this case too?

    In other words, anyone who used the now fixed parts of the canvas object before, have to redo them, even though they're in the cap and setup correctly. Therefore it's possible the same applies to you and your text issue if you're just loading your old cap, running it and seeing it doesn't work. Remake them and then try, it might work just fine then.

  • dude. There is nothing to tell the player what to do or what can kill them.

    It is called Deceptive Forest, maybe that's where he got the title from?

  • I noticed on the newest update, where it mentions part of the canvas being fixed, that anything using those parts of the object from before, need to be redone. Have you tried doing that in this case too? Maybe the things you mention do work, but you just need to remake those parts (the same) first, then save, reload and see if they work for you then?

  • Or you could use erase to see what's really going on behind the Scirra forum!

    Download

    Or simulate using the forum while drunk

    Download

  • > Basically erase + canvas = worms, lemmings.

    >

    Oh so it's only to be used with canvas? that'd explain why I can't figure it out

    Erase works without it too. Put an object in a layer, then another object with the erase effect on top of it and it'll erase what's beneath.

    Example

    Uses the same brightness controls the amount, that a few other effects use. (oooh faded fog effects hehe)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm seeing a lot of posts about this kind of thing lately.. or are they all from you?

    Anyway can it do it right now? = No

    Could a plugin be made to do it? = Yes

  • Same for me, also can't figure out erase effect.

    I think they'd be useful... can any kind soul post a simple example .cap showing them?

    This is a quick example of the erase effect (ignore the canvas not working correct, used this as an example for Ashley the other day). Basically erase + canvas = worms, lemmings.

    I'm still having no luck on mask though, sorry :\</p>

Lost my Keys's avatar

Lost my Keys

Member since 29 Nov, 2009

None one is following Lost my Keys yet!

Trophy Case

  • 15-Year Club

Progress

15/44
How to earn trophies