Grimmy's Forum Posts

  • I think I'm switching to sprites mixed with text

  • ..and how do I prevent this?

    My button object is a regular button with a Set CSS Style event at layout start. This all looks fine but when I click the button it gets a square border around it. This is obviously very visible on a rounded button.

    I have no 'on Click' events.

    See image ..

  • In the end it looks like this is forgotten or lost knowledge, so I used the Set Style action for each property.

    However, to speed things up I basically made families for each button type so that I needed to make less changes.

    I'd still like to know how to do it with a style sheet though...

    Suggestion to Devs If style sheets are a problem, maybe in the 'set style' action there should be just an option to paste in a complete chunk of CSS. That way we don't need to have an action for each property. It's pretty monotonous work..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I read the article for construct 2 at https://www.scirra.com/tutorials/1283/css-your-buttons-and-textboxes and downloaded the example which uses a trick using 'Set Web Font' to load a style directly into a button.

    However, its seems that Construct 3 has no Set Web Font command anywhere.

    SO, how can I do it. Adding each line of CSS action by action is WAAAY to slow, especially as I already have my CSS defined in a file.

    Please help!

  • So this explains how I can type each property by hand (one by one) into an action, but how about if I want my button to use info from a previously created style.css file that I have?

    I've set up my ID in the button properties, I have my style.css in my Files folder in Construct 3 but when I run the game nothing gets changed. I'm not surprised though because I don't know where/how to tell the button to use the attached style sheet. Anyone know?

  • Hmm, not sure this will work because I'm receiving my data directly from an AJAX request. It looks like s you are defining your JSON within the app itself. I cant figure this one out. (?)

  • [quote:1eqqr8ms]You can do it with the browser plugin's execjs action and expression. The only learning curve is dealing with quotation marks ("). You'll want to use single quotes instead ('), or use "" when you want to use a " in Construct expressions.

    This is all great. Thank rou. In your example I don't quite understand where you declare your 'myVar' variable though. Is this declared in an external .js file or something?

    Thanks for taking the trouble!

  • After just buying my C3 license and trying to load in an existing product, I just discovered this MAJOR issue.

    I have a JSON plugin that is core to my project and; as the JSON plugin is no longer supported, I'll never have it in C3 flavour. This of course means my project cannot be imported into C3.

    Not only that, but there doesn't seem to be any JSON plugins for C3 available. In fact, the C3 plugins page is extremely sparse even a year after it's initial release. Personally, there are some 3rd party plugin functionalities that are essential (such as the JSON one) and I'm gutted that C3 cant load them.

    Does anyone know any work arounds apart from just going back to C2?

    Cheers

  • okay thanks!

  • Okay thanks, but maybe this sounds stupid but how and where do I input that into Construct 2. What kind of event/condition/action? Thanks

  • ..not contain a decimal point?

    Basically I have a number. This could be 1 or 1.00 (or any number like this)

    If the number is 1 I want to append '.00' to it so ultimately they all look like the '1.00' format.

    I know I need to use append and the find(src, text) expression but I have no understanding of how to actually put them into contstruct in a logically formatted statement.

    Please help. Coming from traditional programming background a lot of Construct 2 seems a bit backwards to me

    for example....

    if(!myVar.Contains(".")){//do stuff}

    In Construct 2 however I cant figure out how to make the same statement.

    Thanks

  • Okay thanks. I'll probably do my checks at the server end then.

    Out of interest, where exactly is it stored on a windows PC? (Using Chrome in my case..if that matters)

  • So in the end I just needed a php file on my server with the 'allow control header' AND the actual request in the same php file.

    Steps...

    -I put a php file which included the header('Access-Control-Allow-Origin: *'); AND a REST request to the api in question. (So the main difference being that PHP makes the api request NOT C2)

    -This php also spits out the result of the call with echo.

    -I used c2 to call the php file using an axaj POST request

    -C2 then receives the request data using LastData

    All works a charm when uploaded to the server. Hoorah!

    EDIT: I actually REMOVED Access-Control-Allow-Origin: from my PHP file and it all still worked, so presumably the apis that I'm trying to access already have this set at their end.

  • Grimmy

    Rather than necro-posting in a thread over 4 years old (which essentially was fixed), maybe it would be better to create a new post in the C2 Bugs section, ensuring you follow all the requirements.

    If the bug has returned, it would be better if Ashley is made aware.

    Thanks

    Okay will do. Thanks. Apologies for walking on the grave of a dead forum post.