dop2000's Recent Forum Activity

  • Base64 string must have a header - "data:image....."

    See this post:

    construct.net/en/forum/construct-3/how-do-i-8/load-base64-image-sprite-141995

  • You are doing something wrong. If you are not using waits in "for each" loop, then another event (on the same level) will start only after the loop has finished executing.

  • On Drag Start - create a new sprite at this position, copy animation frame from the original sprite. Then the original sprite will be dragged away, and the new sprite will stay.

  • Change in runtime? Use "Set color" effect. It will recolor the entire sprite. If you want to change color for individual pixels, you need to use Canvas plugin.

    construct.net/en/forum/extending-construct-2/addons-29/plugin-canvas-41782

  • There is in fact such plugin - Globals:

    construct.net/en/forum/extending-construct-2/addons-29/plugin-globals-120736

    It's basically just an empty object for storing instance variables. It was made as an alternative to global variables, but can also be used for making enum lists.

  • you could do MyEnum.Choice

    piranha305 Yes, that's what I thought. The dropdown list as on OPs screenshot will not work, as you can't enter expressions into it.

    So you type in "MyEnum." followed by dot into any parameter field in any dialog, and the list of values will drop down. This will be consistent with how other expressions work in C3.

    Also, what will happen if the result of the expression is an invalid number (not member of the enum list), or infinity/NaN/string etc.?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • why in the world would you want a custom input on something that is an enum?

    It's not a custom input, it's a common use case.

    If you have a function "SpawnEnemy" with enum parameter enemy_type (list values: zombie, vampire, troll), how do you spawn a random enemy?

    Or let's say there is a function "SetHealthbarColor" with enum parameter color (red, green, blue etc.) You want to call this function and set color to (Player.health<20 ? red : Player.health<50 ? yellow : green).

    If expressions are not supported for enum parameters, then you'll have to do this:

    If Player.health<20 then Call "SetHealthbarColor", color:red
    Else If Player.health<50 then Call "SetHealthbarColor", color:yellow
    Else Call "SetHealthbarColor", color:green
    

    Three lines of code instead of one!

  • You are proposing enum type for functions because it will make them more organized, easier to use and refactor, and I agree with you. But there must be an option to use expressions with enum parameters. Are you saying that if I want to call my function with parameter choose(Linear,InElastic,InSinusoidal), I will not be able to do it, and will have to use string type parameter instead? This is a serious disadvantage and limitation.

  • Ok, so lets say you have a function "RunMyTween" with enum parameter easing_function. When you call this function, in the dialog you can select the value for easing_function parameter from the list, like this, right?

    But my question still remains - if you need to use an expression instead of selecting the fixed item from the list, how do you do it?

  • We're talking about a new parameter type, not integrating easing modes to functions???

    I'm not talking about it either. But since you used it as an example, you can have a function which is a wrapper for Tween behavior. It will expect easing mode as a parameter, and this parameter can be enum/list type.

  • It seems pretty clear with the image above

    Your image shows dialog window for Tween behavior, it has nothing to do with functions, that's why I found it confusing.

    Besides easing modes, what other lists do you want to have in function parameters, can you please give a few examples?

  • You probably need Destination Atop mode. Set it for a rectangular sprite with solid color, place on the same layer with the text. Don't forget to set "Force own texture" in layer properties.

    You can check Blend Modes template.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 262 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies