Search found 252 matches

Re: How do I check value in array some positions ago

What makes you feel this way?
by mrtumbles
Sat Jan 06, 2018 3:45 pm
 
Forum: How do I....?
Topic: How do I check value in array some positions ago
Replies: 3
Views: 123

Re: How do I make an object stay in the camera zone?

I think you're probably gonna have to post a capx
by mrtumbles
Fri Jan 05, 2018 7:16 pm
 
Forum: How do I....?
Topic: How do I make an object stay in the camera zone?
Replies: 5
Views: 131

Re: How do I make an object stay in the camera zone?

Set object position to:

clamp( Self.X, ViewportLeft( Self.LayerName ), ViewportRight( Self.LayerName ) )
clamp( Self.Y, ViewportTop( Self.LayerName ), ViewportBottom( Self.LayerName ) )
by mrtumbles
Fri Jan 05, 2018 6:06 pm
 
Forum: How do I....?
Topic: How do I make an object stay in the camera zone?
Replies: 5
Views: 131

Re: Let system predict which random sprite it's going to spa

@dop2000 is correct when he says it's probably better to handle the bullet with one object rather than three, presuming the bullets all behave the same otherwise. I like the idea by the way, only allowing the player to shoot matching enemies, that's cool. If you need to do this still (ie, bullets of...
by mrtumbles
Mon Dec 25, 2017 11:09 am
 
Forum: How do I....?
Topic: Let system predict which random sprite it's going to spawn?
Replies: 2
Views: 109

Re: How do I set position after switching layout?

I would definitely try and make it so that the player was represented by the same sprite object everywhere they're present. You're lining yourself up for a headache.
by mrtumbles
Mon Dec 25, 2017 11:03 am
 
Forum: How do I....?
Topic: How do I set position after switching layout?
Replies: 3
Views: 137

How can I make more effective use of Browser.ExecJS?

Just recently I've started using tiny little bits of javascript through the Browser.ExecJS expression. It's neat, and has solved a few problems that vanilla C2 just can't. I'm learning more about javascript now (most of what I've gotten has been cribbed from other sites/this forum), but would anyone...
by mrtumbles
Sun Dec 24, 2017 10:04 am
 
Forum: How do I....?
Topic: How can I make more effective use of Browser.ExecJS?
Replies: 0
Views: 64

Re: How do I set position after switching layout?

Can't view your capx as I'm on mobile - but I would add two global variables to store your position. Call them something like 'ReturnToX' and 'ReturnToY'. Before switching layouts, set the global variables to the player's X and Y. After switching back, set the player's X and Y to the contents of the...
by mrtumbles
Sun Dec 24, 2017 9:44 am
 
Forum: How do I....?
Topic: How do I set position after switching layout?
Replies: 3
Views: 137

Re: How do I get a textarea's cursor (caret) position?

Self-solved! First bit of javascript I sorted out for myself... Browser.ExecJS ( "{ var ctl = document.getElementById('code'); var startPos = ctl.selectionStart; var endPos = ctl.selectionEnd; startPos + "","" + endPos; }" ) Where "code" is the ID of the texta...
by mrtumbles
Fri Dec 01, 2017 11:12 am
 
Forum: How do I....?
Topic: [solved!] How do I get a textarea's cursor (caret) position?
Replies: 1
Views: 70

[solved!] How do I get a textarea's cursor (caret) position?

I want to add a quick reference system to my procedural generator scripting engine. Functions in the script are called line-by-line, so if I can determine the cursor's position in the scripting textarea, I can provide accurate and relevant tooltips etc. I know the javascript properties selectionStar...
by mrtumbles
Thu Nov 30, 2017 11:23 pm
 
Forum: How do I....?
Topic: [solved!] How do I get a textarea's cursor (caret) position?
Replies: 1
Views: 70

Re: How do I Dynamically move items/sprites.

I don't know about a plugin, but it's easy enough to do by just checking for overlaps. Do you want your objects to shuffle left, right, up, down, or just towards the centre? Either way, use detect overlap at offset in the direction you want everything to move. If it doesn't overlap another object, m...
by mrtumbles
Tue Nov 21, 2017 10:03 am
 
Forum: How do I....?
Topic: How do I Dynamically move items/sprites.
Replies: 1
Views: 74
Next

Return to advanced search