Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Czar

  1. This maths parser http://mathjs.org/ looks like a library I could really use. However, I am having difficulties incorporating into SMS I have the js file in the lib subfolder But I am stuck how to 1. pass through a string to parse 2. retrieve the result console.log(math.sqrt(-4)) I can't find any posts or information on how to even start. math.js
  2. Yes I am using RequestAnimationFrame The tw3sprite is perfect for animation for our maths exercises - the software is not a game it mainlky uses editboxes and labels etc so the visual components are better than using canvas. The preloading solves the flash issue so I am happy again. I use canvas when converting directx games
  3. I think I may have solved it by preloading the images into a tw3image The following solved my flash issue - posting for completeness. And yes the procedure can be simpler procedure TForm1.PreloadImages(MyImage : tw3image; MyImageName : string); begin MyImage.visible := false; MyImage.LoadFromUrl(MyImageName); end; procedure TForm1.InitializeForm; begin inherited; PreloadImages(tw3image.create(self), 'res/girlidle.png'); PreloadImages(tw3image.create(self), 'res/girlwalk.png'); PreloadImages(tw3image.create(self), 'res/girlattack.png'); PreloadImages(tw3image.create(sel
  4. When you set the background of a tw3sprite there is a noticeable flash when you switch from one image to another. I am using different PNGs for simple animation but I cannot seem to prevent the momentary blip where nothing is drawn. e.g., if I am displaying walking animation and I switch to the following sprite.Handle.style['background'] := 'res/girlidle.png'; there is a flicker on the screen. Not too noticeable in chrome but it is in my embedded chromium app and in the internal server. How can I prevent the screen updating until new background has loaded? Is th
  5. Yes, the themes in the IDE are poked. The IDE is a bit temperamental in a number of areas. Most annoying for me is double clicks a button to create an action and have cascading errors instead
  6. Czar


    Visually it looks interesting. I am getting about 20 fps - it is not clear who I am or what I am doing
  7. Czar


    I feel that method might not be the best way to go about it. You could render to offscreen image and then copy to main image. Also I wonder if you might have difficulty because you are going from height x width to a width x height q@Christian
  8. Unlike this one buried in Gilligan's Gold - Ocean game from 1984 buried in Gillian
  9. True, I will have a look at those options. But given we have servers online I will probably go with easy
  10. @lynkfs- I liked the ability to upload an image. But I was hoping to store that image server-side. So, yes, I am referring to your edited section. I might use a php script to upload the images - or simply ftp them up when required. I am making a little inhouse app to allow our franchisees to make personalised ads - i.e., image add in their phone number etc and then download the result to their computer. I was simply looking for a way to allow a colleague to upload the images without my help
  11. How would this sample be extended so that the image uploaded is stored in the (for example) /res folder? Is that possible? If so how?
  12. @lennartwould that also explain why LBitmap.Canvas.TextWidth('mytext') always returns zero?
  13. @jartoI have tried a bunch of things but I cannot change size, style or anything related to the default font when using text out. Are you able to doa quick example? As LBitmap.Canvas.Font.size := 28; doesn't work
  14. Ok this driving me to distraction. The sample above work great so I thought I would add text to my image var LBitmap: TBitmap; LRect: TRect; begin LBitmap := TBitmap.Create; try LBitmap.Allocate(640, 480); LRect := TRect.Create(0, 0, LBitmap.width-1, LBitmap.Height-1); LBitmap.Canvas.Brush.Color := clRed; LBitmap.Canvas.FillRect(LRect); LBitmap.Canvas.Font.size := 28; LBitmap.Canvas.TextOut(10,10, 'It displays text but in small font', clblack); var LEncodedData:= LBitmap.Canvas.ToDataURL('image/png'); w3image1.LoadFromUrl(LEncodedData);
  15. Thanks Jon https://jonlennartaasenden.wordpress.com/2018/08/05/graphics-essentials-in-smart-mobile-studio-3/
  16. Didn't even realise that was a possibility. I create a symlink to a network folder containing our common files. That way more than one developer has access to the same common files. Just make sure you create it inside the RTL folder. When IDE starts up it will be able to access the other files in the symlink
  17. Czar

    Font Demo

    I am trying to find a demo that uses different fonts loaded from the internet. I cannot find a suitable sample, anyone got an idea? ideally something basic like how to load (for example) a cursive font and then set a label to use the new font.
  18. Czar

    Paint box

    This FImg.ToStream( is no longer possible I am trying to figure out to turn an image in to a stream - it is not as straightforward as it used to be
  19. Ok, next problem - I cannot find a way to turn a tw3image into a stream. Or the canvas of a paintbox
  20. Colleagues have asked me if it possible to set a system where-by franchisees can edit text for social media ads. i.e., I display an image in their browser, they can edit the text and when they are done a PNG or JPG can be downloaded. I am just not sure about the last step - downloading. I know javascript is not supposed to access local machine but there must be a way to do it - my question is how easy is it to implement and can someone point me in the right direction? cheers
  21. Yup, I am for anything that makes sense and improves usability.
  22. procedure TForm1.W3EditBox1KeyDown(Sender: TObject; const KeyCode: Integer); begin if (keyCode < 48) or (keyCode > 57) then //numbers if (keyCode <> 8 ) and (keycode<>46) and (keyCode <> 37) and (keyCode <>39) and (keyCode <>46) then BrowserAPI.EventObject.preventDefault; end; Would it be possible to extend the keydown event so that "AllowKey : boolean = true" is added which would do the "BrowserAPI.EventObject.preventDefault;"? That would make it more obvious and usable. QUESTION: why does the "delete key
  23. That is a pretty excellent solution. I will make one suggestion if (e.keyCode <> 8 ) and (e.keyCode <> 37) and (e.keyCode <> 39) then e.preventDefault(); //allow backspace and arrow keys So then arrow keys can be used.
  24. That is a sneaky solution - increasing max length after testing the keystroke - nice A few issues if typing too quickly.
  25. That is basically the solution we too came up with. Ideally the characters should never appear, looks a bit nicer. If not possible then either this solution or the inputtype solution, inserted below, will have to do In javascript it is possible to "not allow" a key press - that would be a great function to add to tw3editbox @jarto <INPUT id="txtChar" onkeypress="return false;" type="text" name="txtChar">
  • Create New...