Fengist's Recent Forum Activity

  • Fengist - that sounds like the same case as discussed here. Presumably you're visiting editor.construct.net?

    It would be useful to remember: beta releases are never served from editor.construct.net - that only serves the latest stable release (which is what the typical user will want). If you want to be using a beta release you must have the release number in the URL, e.g. editor.construct.net/r146.

    Actually, I'm using the installed app. I just click and open the desktop icon. The confusion arises when it realizes I'm not using the latest beta and asks me if I want to "upgrade". When I select yes, It doesn't actually upgrade the desktop app, It appears that it closes the app, launches the browser and takes me to the latest beta URL. Because it doesn't upgrade, the next time that I launch from the desktop app, it's still not updated and asks me again.

    It would seem that as long as I'm running the beta and using the desktop app, I have 2 choices. Uninstall and reinstall when a new beta comes out or just keep clicking the "upgrade" button.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My situation was similar. Relying heavily on functions and just getting started in development I switched to the beta branch in an effort to not have to rewrite functions later. What I expected was that when a new version came out and it asked to update, that it would update the app and keep it. Instead the app seems to be keeping the version installed when I initially switched to beta so that now, every time I start the app, it asks to update.

  • Is there a better way to print pages using construct 3 that I'm not aware of?

    I'm going to assume that you'll need to print different cards at different times for different players and that you're going to want these cards in a high resolution. Here's my initial thoughts on how I'd tackle this:

    1. Have a MYSQL database that contains all of the information needed for each possible card including images.

    2. Have C3 do an ajax call to a php script that selects the cards from the database depending on what the POST parameters from the AJAX call is.

    3. Have the php script use one of the pdf libraries available to build a pdf file containing the cards in the proper layout.

    4. Once the php script builds the pdf file, have it reply to the AJAX call with the location of that pdf file and then, C3 provides an external link to it. Once it's displayed in a browser, the end user can decide what to do with it.

    Two minor details. I've only worked with one pdf library and while it does work and the print quality is what you'd expect from a pdf, it's essentially it's own programming language. Getting that set up would be a chore. And, getting rid of the pdf file after a period of time would require some forethought. Of course, you could e-mail it to the player with php and delete it immediately.

  • Yea, it's confusing me. I'm running the beta so I don't have to screw with functions when that goes live. When I run the app from the desktop it keeps asking to update and I keep telling it to update. It apparently doesn't. So, I did something stupid. I told it to install the new version as an an app at which point I had 2 desktop icons. I then ran the old version and told it to uninstall.

    It uninstalled both.

    So now, if I go back to editor.construct.net it's telling me I have r142.2 installed and it wants to upgrade to 145. If I do the upgrade, I can't install as an app. But, if I run the r142.2, I can install as an app.

    So, I reinstalled r142.2 as an app and now, it's back to asking me to update every time I run it.

    *boggle*

  • If you've upgraded to C3:

    construct.net/en/make-games/addons/190/html-element

    That'll allow you to create a box with HTML and CSS instead of bb code and you can add coding into the HTML to call C3 functions based on events like clicks or mouse overs.

  • Nevermind, my stupidity. Six hours of tearing a plugin apart and I find a line in the c3 code I didn't remember adding that adjusted it's width again. Duh.

  • I hope you're subscribed to this thread. I posted a new issue on GitHub.

  • Ok, I'm using this plugin:

    construct.net/en/make-games/addons/190/html-element

    Here's the problem. When the browser is resized, the plugin resizes as well. I need this size to remain static. I've left an issue report with the creator but no response yet. I've attempted to fix this myself but the problem is, I'm a PHP programmer, not a JS programmer and I'm not sure what I'm looking at.

    I think I've narrowed the problem down to one function in the plugin code but can't come up with a solution. Here's the code:

    DrawSize() {
    
    
     if (!this.domStructure.useC3size) return;
    
    
     // conservo la dimensione precedente
     // se è uguale non devo fare nulla
     const exWidth = Dom.width(this.el);
     const exHeight = Dom.height(this.el);
    
     // mi prendo i riferimenti per calcolare le dimensioni
     const wi = this._inst.GetWorldInfo();
     const layer = wi.GetLayer();
     const quad = wi.GetBoundingQuad();
     // prendo l'angolo in alto a sinistra e poi le coordinate in alto a dx e in basso a sx
     const tlx = quad.getTlx();
     const tly = quad.getTly();
     const trx = quad.getTrx();
     const bly = quad.getBly();
    
     // calcolo le nuove dimensioni
    
     const myinstance = this._inst.GetWorldInfo();
     const instWidth = myinstance.GetWidth();
     const instHeight = myinstance.GetHeight();
     const newWidth = Math.abs(layer.LayerToDrawSurface(instWidth,0)[0]);
     const newHeight = Math.abs(layer.LayerToDrawSurface(0, instHeight)[1]);
    
     // se le nuove dimensioni sono diverse da quelle precedenti
     // allora aggiorno la dimensione dell'elemento
     if (exWidth !== newWidth || exHeight !== newHeight || this.memory.resizeWindowForSize) {
     this.memory.resizeWindowForSize = false;
     this.SetStyle({
     'width': newWidth + 'px',
     'height': newHeight + 'px'
     });
     }
     },
    

    If I drop this plugin on a form and do a simple browser.onResized and set the size of the HTML Element box to random(100,500), random(100,500) the height will randomize. The width does not. It adjusts based only on the browser size.

    Any help would be appreciated.

  • Your solution is pretty much how I'm handling it. Ajax requests are sent to various PHP files on a web server. The PHP files then make requests from a MYSQL database and echo the results which C3 picks up as the Ajax results.

    The problem with this method: It's not fast. Depending on the server load (shared hosting), or how much processing the PHP file has to do or ping times, it could be seconds before you get results back.

    Make sure that, if you need to, lock any controls to prevent repeatedly sending the Ajax request multiple times until the request gets and answer or it errors out.

  • Construct could not parse string literals in the way you expected, because it would make it impossible to set some strings. For example if it parsed the string as an expression, you couldn't set a string to the word "newline", because it would interpret it as an expression and insert a newline character; you couldn't set a string to "1+1" because it would evaluate it and set it to 2; and so on...

    Right, I understand the reasoning behind the parsing or lack thereof, it was just a bit unexpected. The logic I was working under was, if I set the string manually and it behaves a certain way, then when I set it dynamically, it should behave the same. I was expecting that anything within double quotes wouldn't be parsed and anything outside would.

    Now that I know the convention, it'll be easy enough to work with.

    Thanks.

  • Well, thanks for the confirmation guys. With the strange C3 conventions on adding strings and newlines together I expected it to parse the &newline& but yea, this works and I have no problem typing \r\n to make it work.

  • Ok, I've tried multiple methods to do this and so far, no success.

    If I manually set the contents of a text.text to "This" & newline & "That" It properly displays: This on one line and That on a second line.

    If I try to set the text.text from a JSON.Get("MyKey") to "This" & newline & "That" I get: "This" & newline & "That"

    I have tried various combinations of removing quotes, adding quotes, etc. Whatever I do, it doesn't seem to be parsing the text field properly and adding in the newline.

    *edit*

    Ok, this was not what I expected as the answer but it works:

    I was creating a JSON in PHP and sending it back to C3 with an Ajax request and having C3 fill in the text field with the JSON value. I stupidly assumed that if I sent the text as C3 expected to find it that it would parse it and add in the newlines. It appears it does not. This solution seems to bypass the need for Construct to parse the line and properly adds in newlines.

    $jsonObject->Error = '"This" & newline & "That"'; // does not work

    $jsonObject->Error = "This\r\nThat"; //does work

Fengist's avatar

Fengist

Member since 6 Nov, 2015

Twitter
Fengist has 5 followers

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x3
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies