farhanx's Forum Posts

  • thorntonp72 have you found the solution ??? Kindly update here i am on the same track having same errors

  • I am making a small digital ebook type game for this i need to stretch the background image correctly on all kinds of layout. But i am bit confuse how to do that , i have seen Scale inner is good choice but it also cuts the screen from different sides. I need the game should be compatible with all kinds of screens from windows phone , iphone , ipad and android based phones.

    If anyone has done this before kindly guide me the best way to do that. Actually i have made everything by now and game is ready the only issue i am facing is the multi resolution issue.

  • I have a family of different tiles each tile represent group of alphabets for e.g.

    Image1 A,B,C,D is one image with 4 different sprite frames

    Image2 E,F,G,H is another image with 4 different sprite frames

    i have put them in one Family and its name is AlphabetFamily

    Now i want to create the object based of this AlphabetFamily but i also want to choose what image to be create and set its instance variable. When i create object it randomly selects sometime image1 or image2 when i use Create Object AlphabetFamily. But i just want to control this myself so i can create object with FAMILY name but point to the image i want to be refer. Right now i could not find any solution and due to it i have to create Object Image1 explicitly which is difficult since it has so many variables to be set...but this can be solved if there is any action like

    Create AlphabetFamily object

    AlphabetFamily must be image of Image1

    AlphabetFamily.variable1 =2

    AlphabetFamily.variable2 =3

    etc

    is there is something that can help me like above ??

  • But one thing that we cannot add instance variable based on each frame but per instance so it means i cannot hard code their ids value so at the time of creation i can pick them via their id instead of remembering their frame key. For e.g.

    User has input X

    Create object XYZ

    Get the frame of object XYZ which contain id X

    since i need to create an object dynamically based on user input...what you think???

  • not a bad idea , but these each sprites has different sizes and their categories are different from each other they cannot be merge together as frame. Plus suppose if i follow that then again saving each sprite's frame data is not supported by construct2 like say frame1 contain instance variable id 101 and frame2 instance varibale id contain 3....for this i need to create separate dictionary or array.... any more ideas??

  • I could have around 100 different sprites , and these 100 sprites has different scoring points. My game works like if the user give a integer input as an id then that particular sprite whose id is same will be made and display on the screen... The problem is using "Create Object" provides a list to select the object...which means based on user input id i have to put 100 different type of "if cases" ... e.g.

    if user input 11 then create sprite whose id is 11 .... if 12 then create 12 ...

    Is there any other way to create dynamic object based on user input rather than hardcoding the object list 100 times???If its not available then any other tip or way to achieve the same ??

  • I need to referesh my construct2 canvas by a hyperlink on my html5 document ...i tried the following code

    var c=document.getElementById("c2canvas");
    var ctx=c.getContext("2d");
    ctx.clearRect(0,0,500,580);
    
    [/code:2dj2fo5h]
    
    I thought maybe clearing the rect may call OnlayourStart function but i am getting null object in my ctx...then somewhere on internet i found this code where it was written it can refresh the canvas from the start.
    [code:2dj2fo5h]
    var oldcanv = document.getElementById('c2canvas');
    document.removeChild(c2canvas)
    
    var canv = document.createElement('c2canvas');
    canv.id = 'canvas';
    document.body.appendChild(c2canvas);[/code:2dj2fo5h]
    
    but this also did not work , i just need simple way to re-load my whole construct2 canvas by hyperlink ..so the "On start Layout" would get call one time by its trigger whenever someone clicks the hyperlink.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i was wondering how can i replicate the mouseover event using touch object. Suppose if user come over on any sprite object then rather than detecting click i need to detect if that user finger is on that particular sprite ....

  • yes i have looked at this tutorial ..but the author has not target the cooconjs , my problem is I am using

    cocoonjs since i need to make my game for ios. So when i export my construct2 game using cocoonjs then the index file i see only with the following code.

    <html>

    <body>

    <script src="c2runtime.js">

    </script>

    </body>

    </html>

    Now i do not know how to go with this one...suppose if i need to create a div panel then shall i add this script js inside or it will load it by it self ??? I need to create a proper web form using div , i have used APP Framework of IntelXDK but when i test it with launcher in ios i see abnormal screen..

  • after i export my game in cocoonjs i get index file , that index file contain only following code

    <html>
    	<body>
    		<script src="c2runtime.js">
    		</script>
    	</body>
    </html>[/code:1j2b524d]
    
    I was wondering can i add html based forms and sub pages in this index file ?  I did the same thing using android with crosswalk but the cocoonjs exported code is totally un managed and unorganized without folders... If anyone has done this before if yes then kindly share your experiences and samples???? 
    
    Note: i tried to add few things but nothing works
  • suppose if i create a simple html5 page and put it inside the same directory of the exported construct2 files then how can i load that html5 page using browser object? The browser object only takes http web address but i want to target the static file beside the index file of the game? is it possible?

  • farhanx You should take a look at the new CJS plugin! It supports native textfields now! (It's included in the latest C2)

    Webfonts can appear differently on different devices, I suggest using Spritefonts for consistency-http://www.scirra.com/forum/sprite-font-generator_topic72160.html

    For lists, however, you'll have to create your own solution to that (unless someone already has one, might be one on the forums somewhere)

    I checked their demo it opens a popup alertbox to obtain the test ... its sad that there are no other way to display textfield and other stuff using cocoonjs?

  • how about ajax based communications

  • Form is the required thing for my game , but cocoonjs does not display textfield , webfonts and listboxes. What is the best solution to make forms that will run on all platforms without any issue???

  • hi,

    I am going to ask a very difficult question which has not been answer yet on "Construct2" forum. I believe no one has done this thing before or maybe i am unable to find the existing solution on any forum or tutorial yet...

    Here are my intention

    1) I need to make configuration and game option screens using XDK APP framework they will communicate through ajax etc so i am using app designer.

    2) I need to create a game in construct2 , which i have made it. Because canvas base game is only possible in C2 not in intelXDK app designer.

    3) I have exported my game in C2 using Crosswalk Android export , and then i have added that game code manually inside the index file of my intelXDK app designer project.

    4) Emulator display correct game and after building through crosswalk of intel XDK for android it even ran on android device without any problem.

    NOW the problem comes

    1) I want to build same game for window phone and for IOS iphone ipad.

    2) According to the construct2 i need to use export for each device , since for android they give us crosswalk export but for IOS / Windows8 they have different approach like ejecta/cocoonjs and visual studio etc..

    My question is how can i export my c2 game so i can merge this with my APP which is built using intelXDK app designer....

    Kindly help me i am very much confuse because i likes to use construct2 combined with intelXDK app framwork ...for all the platforms

    I have asked this question even on intel XDK App framework forum they also suggested the answers only C2 forum can give us for the merge of these two technologies ...

    https://forums.html5dev-software.intel. ... =31&t=6603