jatin1726's Forum Posts

  • Hi Friends,

    I need help in inserting result of this weather api into a text box. Api is openweather api. Iam not good into reading api. Can you please help me in extracting api result value in text box.

    	<html>
    		<body>
    api : "https://api.openweathermap.org/data/2.5/weather?q=mumbai&units=imperial&appid=d5bce51716019821834a169506c4fce6"
    		</body>
    	</html>
    

    "https://api.openweathermap.org/data/2.5/weather?q=mumbai&units=imperial&appid=d5bce51716019821834a169506c4fce6"

    Please help guys. Need this urgently.

    Thanks in advance.

  • > updated link

    hi, link is not showing result as yahoo has deprecated this api. can you please upload newer capx working one?

    Thanks

    guys please help me

  • > You mean instead of the list 1 item wide and 100 rows down you want it to be 4 items wide and 25 rows down?

    > dropbox.com/s/1676stwx1ysnz9n/ScrollingList4columns.capx

    Hi Dop,

    Yup like this but two things I noticed, this way it is not going to be responsive and secondly mouse scroll never works, can you tell me how mouse scroll will work?

    Dop, sorry to bring it here, but very urgently need help to display current location weather. Can you help me with construct 2 in that ? old capx here is not working at all of forums.

  • You mean instead of the list 1 item wide and 100 rows down you want it to be 4 items wide and 25 rows down?

    https://www.dropbox.com/s/1676stwx1ysnz9n/ScrollingList4columns.capx?dl=0

    Hi Dop,

    Yup like this but two things I noticed, this way it is not going to be responsive and secondly mouse scroll never works, can you tell me how mouse scroll will work?

  • Hi Friends,

    Need help in displaying images1 when it is raining and image 2 when it is sunny. How can i achieve this using free api. I checked forums but old examples are no longer working. Most of their api have been deprecated. Please help me. Need urgent help.

  • If you load images from URL, you still need 100 empty frames. So set frames from 0 to 99 for all 100 instances of the sprite. Add an instance variable isImageLoaded, and add this code:

    > Every 0.1 seconds
    Sprite isImageLoaded=0
    Sprite Y<3000
    	Sprite load image from URL "http://mywebsite.com/pic" & Sprite.animationFrame & ".jpg"
    	Sprite set isImageLoaded to 1
    
    

    Hi Dop,

    That worked nicely, thanks a lot for the support. After implementing this I am stuck with a new issue. The sample capx you have shared for scroll up works good if it has one column. If it has more than 3 or 4 coloumn then (we can assume each thumbnail is square may be of 300x300px). We usually see websites like this. How can I implement your code for multiple coloumns. Thanks in advance.

  • If you want it here's a quick capx example :

    https://dl.dropboxusercontent.com/u/139218609/examples/weather.capx

    There's a lot more information returned from the request then what i choose to list, chance of precipitation, wind speeds...

    I understand that this thread is very old but I need it urgently. Can anyone please upload weather api capx please.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • updated link

    hi, link is not showing result as yahoo has deprecated this api. can you please upload newer capx working one?

    Thanks

  • It depends - where do you have these 100 images? are they all in one sprite (as frames/animations), or multiple sprites, or do you load them from web in runtime?

    If you have one sprite with 100 frames, there is nothing you can do, the whole sprite will be loaded on layout start. If you have 100 separate sprites, you can create them as user scrolls down.

    Hi Dop,

    As of now I have 100 frames in one sprite. so It is difficult to implement lazy loading. I also tried that I should try capturing UID of the box created in realtime and give it some sequential id and then call image from url. But it is not working. It always load same image for 100 blocks. so I am stuck in implementation of lazy loading. and my list is becoming heavier due to so many images have to loaded while lading the game. Can you help me out in this?

    REgards,

    jatin

  • > > Thanks mate!!! That worked fantastic!

    > > I didn't know that i can pick items that easily if i put them in container!

    >

    > Hi Can you share the list example. I also need it for my project.

    https://i.postimg.cc/28hqqfwD/list1.jpg[/img]

    https://i.postimg.cc/fRsVmg20/list2.jpg[/img]

    This is how i implemented scrollable list in my project. If you have any question, feel free to ask.

    Thanks for the code. Can you share capx too. It will help in better understanding.

    Dop and your help I need for lazy loading thing for scrolling list. Assume for scrolling list there are 100 blocks and each block has unique image. Construct 2 loads all images before starting the game right so downloading 100 images will add lot of delay to the game. Here as a solution websites use lazy loading. For example, in first view only 10 blocks are visible so only 10 images are download. When user scrolls further, 5 new blocks are added to the screen so only 5 new images are download thus it saved unnecessary downloading of images. Can you help out in achieving the same.

    Regards,

    Jatin

  • Are you talking about the last formula? It should work with any number of frames in the animation.

    .

    I am not very good at explaining..

    (((mouse.X-startX)/8)+(Sprite4.AnimationFrameCount*10)+startFrame)%Sprite4.AnimationFrameCount

    Here "8" means sensitivity - frame will change every 8 pixels.

    %Sprite4.AnimationFrameCount is the remainder after division. For example, 50%36 will give you frame number 14 in animation with 36 frames.

    (Sprite4.AnimationFrameCount*10) - this part of the formula is needed to prevent the value in brackets to go into negative numbers (when you swipe to the left). It basically just adds 360. For example:

    (10+360)%36=10

    (-10+360)%36=26

    Thanks dop for such nice explanation. It is really helpful but you r bad lier, u said you r not good explainer but I feel you are good in explaining the solution. God bless you.

  • Check if this is your problem.

    Eliminate "restart layout" because you are resetting the layout to the initial values, then you can never set the new values.

    Thanks, mink for sharing the solution. though I can't remove the restart layout as it plays a cruicial part in my code. I spent some more time and got the issue fixed with keeping restart functionality intact.

  • Ok, I fixed it, see this demo:

    https://www.dropbox.com/s/7rrjq240qvwsykq/slider-pulsar2.capx?dl=0

    Thanks a ton dop. it worked very nicely now. 100% working solution. But I have one question, what is the solution formula you applied for animation frame on touch/mouse. Bcz when I tried the same 360 rotation on object with 23 frames (instead of 35 of pulsar demo capx), it acted wierdly though rotated smoothely. On swiping towards right, bike was rotating towards left side and vice versa instead of goign into the same direct as of touch direction. I think the secret is behind the formula u applied, can you explain it a bit. That will be very helpful.

  • Hi Friends,

    I want to add google analytics for tracking imp and events by users. Could anyone please guide me how to do that?

    Regards,

    Jatin

  • Sorry, I don't understand. You can rotate the image left and right many times, not just once.

    It rotates with jerk on touch start. oN each touch start it starts from same fixed point instead of from the point where user touches.