VikasSanstha's Forum Posts

  • If you check the JSON file, I removed the rgb().

    When you run the debug mode, you will see the different of 2 array.

    The bgColorEvents at 0 will be 10656511 instead rgb(255, 154, 162).

    So I think the Color of the BG when your get from the bgColorArrayEditor is just a string "rgb(255, 154, 162)" not a color.

    Then I break it to separate numbers R, G, B.

    When get from bgColorArrayEditor with randomY, example ramdomY = 0:

    - tokenat(bgColorArrayEditor.At(0,0) = "255, 154, 162"

    - R : int("255, 154, 162", 0,",")) = 255

    - G : int("255, 154, 162", 1,",")) = 154

    - B : int("255, 154, 162", 2,",")) = 162

    Then put all params inside the rgb() to make it a true color.

    Hope this is clear for you!

    Thanks so much for your time and expertise. Greatly appreciated! I will have to study this for a bit, but I'm eager to understand and learn, so thanks.

  • Choose and arrays are not options to achieve this.

  • Use choose("car", "truck", "bus") & ".png" in your URL.

    I have hundreds of images though, and they will occassionally be changed and refreshed. Also many separate lessons, so in the big picture thousands. Much easier if it's automatic. Choose is not really a viable option in this case.

  • Why don't you make it with revert way?

    - You have the name of the png.

    - Have variable call nameOfImg.

    - Load Image from URL with the path is nameOfImg&".png"

    - Then you display the nameOfImg in text.

    - And the nameOfImg can be random like choose("dog", "cat").

    How does it know what image to load though? I don't want the instruction for what image to load to be derived from text that I have to type. It can't use choose.

    I want it to load images from the project files folder that have unique filenames (not a common base followed by a number sequence) - either randomly or alphabetically, and then to derive the text in the textbox from the filename.

    I know this is possible in plain js. I didn't do it, but the programmer I was working with did. Just hoping it can be done it C3 also.

    Thanks for any assistance.

  • I updated a bit here:

    https://drive.google.com/file/d/1VE2Yy2aApd2obzuJtWOpGKfgJURmvhPS/view?usp=sharing

    Thanks so much for sharing your expertise. I see now that it was not as simple as I was imagining it to be. Can you help verify that I understand what's going on?

    int(tokenat(bgColorArrayEditor.At(0,randomY), 0,","))

    This is the part I'm not quite clear on, what each value is and what it's doing

    (0,randomY), 0,","))

    Thanks again!

  • If I have

    car.png

    truck.png

    bus.png

    in the files section of the project, how can I randomly load one of them using load image from url. I know how to do it if they have the same base and a number.

    I've read every old post that seems related, and nothing. It would be terribly disappointing if this is not possible. Seems like it should definitely be doable.

    I also can't figure out how to simply load the first one, and then advance through them as the user clicks some sort of next trigger.

    Thanks for any assistance.

  • I am loading random images into a sprite using load from url (but just using the c3 project files folder).

    How do I set the text in a text box to de dervied from the filename prefix of the image file?

    Use:

    1) I have two images in the files folder - dog.png and cat.png

    2) A button is clicked and cat.png is loaded into the sprite via load from url event

    3) the text in a textbox is therefore set to say cat

    Many thanks for any assistance!

  • Got that (an oversight on my part), but I just deleted the first empty column, and it still does not work. I thought that this was telling to use the height and not width.

    bgColorArrayEditor.At(0,randomY)

    Thanks, I have reposted the project file

    dropbox.com/s/cr6fxdwwcp9gur5/bgColorArrayTest.c3p

  • Click the button to change the bg to a color from a list of values. I have it working fine when I populate an array by using the event sheet, but when I put the colors into a JSON file I can't get it to work.

    Many thanks, any help is greatly appreciated.

    dropbox.com/s/fp0h0jw2h5pb8ze/changeBgColor3.c3p

  • I have tried for hours to get this working with one array that has a column for English and another for Hindi. It's not hard to get it working basically, but I cannot do it so that it preserves all of the current behaviors, which is critical.

    The behaviors that have to be preserved (these are working perfectly in the attached project file):

    1. When the user changes to the other language the background color should not change
    2. When the user advances forward or backwards, the language doesn't change. If it was Hindi, it stays Hindi, etc. This is most important.
    3. The TTS, which is triggered by the sound icon, or by clicking on the picture or sentence, needs to still read the correct sentence.
    4. The counter

    In the posted file below I have added the Hindi to the English array (which in the new scheme would just become the one array), but that's all. The event sheet is still using both arrays.

    https://www.dropbox.com/s/92bpwos67bwd06b/Sentence%20tutor%20one%20array.c3p?dl=0

    Any assistance is greatly appreciated. I have exhuasted my capability to achieve this. This would be an extremely useful thing for me to learn and understand, as almost all of the work I'm doing is bi-lingual, and this is a much easier way for me to work, with one array that has both translations.

    Thanks again!

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Thanks so much for the feedback! I have implemented an additional JSON file with Hindi translations, and a language switching mechanism. It works OK, but I'm sure it could be more elegantly constructed. I would really appreciate any feedback if possible.

    The only thing I know I am just doing wrong is that it won't switch to Hindi on the first sentence (on the first sentence only). It actually does switch to Hindi (if you click the picture for the first sentence you'll hear the Hindi TTS), but it doesn't show the sentence. Again, only for the first sentence.

    Other than that, it all works, but it really frustrates me to know that I could be doing it in a more elegant and efficient and sensible manner. For example, I'm sure my treatment of the flag outlines is unecessarily complex. I'm very motivated to learn.

    dropbox.com/s/7jw75rbzv1qyegt/VikasSanstha%20sentence%20practice.c3p

    Many thanks again! You have been so helpful. I'm a teacher in India and this is for my students to practice reading in both languages.