I realized that the Line Chart Drag Point is not really sensitive and it is difficult to select a point to drag. Aside from that, occasionally might trigger the wrong point. I wanted to ask is there workaround can solve this issue? I checked the example code the DragPoint basically selects the entire Line but not the point (I guess?). Other than that, TeeChart is a great library for charts! Any comments and answers will be highly appreciated.
Line seriesLine;
seriesLine = new Line(chart.getChart());
seriesLine.fillSampleValues(5);
SeriesPointer tmpPointer = seriesLine.getPointer();
tmpPointer.setInflateMargins(true);
tmpPointer.setVisible(true);
tmpPointer.setVertSize(10);
tmpPointer.setHorizSize(10);
DragPoint toolDragPoint;
toolDragPoint = new DragPoint(seriesLine);
toolDragPoint.setStyle(DragPointStyle.BOTH);
You are right. It seems the pointer isn't clickable&draggable.
I've found the fix for the problem here also fixes this. So I've applied the same fix for the Java version.
This will be available with the next maintenance release.
Related
I want to make a touch or tap somewhere on a widget without making the user explicitly touch the screen at that point. Is there any way to do so?
I've checked SO answers, and some recommend using "integration tests" but which is not available to do on devices which aren't physically or in some way connected to the laptop (couldn't find a better wording).
I also attempted to do a hitTest wondering if it actually touches or taps the screen at that point, while interacting with the UI, but seems like it doesn't.
onPressed: () {
RenderObject? rb = context.findRenderObject();
if (rb is RenderBox){
final hit = BoxHitTestResult();
if (rb.hitTest(hit, position: Offset(300,500))){
print(hit.path);
}
}
},
Also, please understand the question right, as in many of the answers I've been reading regarding my query has been answered with "you don't need it, just call the function/method". I want to "simulate" a tap on a certain specified position of the screen, maybe according the X,Y axis as I attempted on the code.
An honest thank you for any directions.
If anything is lacking in my question, please let me know.
Edit: (The following is an update to what I'm finding)
I went diving into the Flutter codes. I found a few files:
Under flutter/src/gestures/hit_test.dart I found void handleEvent(PointerEvent event, HitTestEntry entry);. I assume it consumes a PointerEvent. Checking further,
Under flutter/src/gestures/events.dart I find class PointerDownEvent extends PointerEvent and under flutter_test/src/test_pointer.dart
I find class TestPointer
Would any of these files give any light to what I want to do? I'm checking through.
Thanks to #pskink , the following code works the best for me/ the situation. I've been able to make the taps as wanted. Thank you very much.
WidgetsBinding.instance!.handlePointerEvent(PointerDownEvent(pointer: 0, position: Offset(100, 100),)); WidgetsBinding.instance!.handlePointerEvent(PointerUpEvent(pointer: 0,position: Offset(100, 100),));
The documentation online did not have these two actions (CAMERA_FOCUS and CAMERA_ZOOM). Could anyone tell me what parameters are acceptable for these actions? I'm assuming it would only work with the Inspire drones which is what I'm working with. Thank you.
Current documentation:
CAMERA_FOCUS and CAMERA_ZOOM available in SDK:
How the zoom function waypoint action basically works the same way as the setOpticalZoomFocalLength function in DJICamera.
You will need to calculate the focal length value to pass in base on the current lens you are using. The max and min focal length values you can find under getOpticalZoomSpec function.
More information on setOpticalZoomFocalLength in DJI android sdk api:
https://developer.dji.com/mobile-sdk/documentation/cn/faq/cn/api-reference/android-api/Components/Camera/DJICamera.html#djicamera_camerasettings_setopticalzoomfocallength_inline
Hope that helps.
Not really sure what is your meaning.
I guess you want to know how to control camera focus/zoom using DJI MSDK? refer to their class reference and call the corresponding function. EZ as ABC
https://developer.dji.com/cn/mobile-sdk/documentation/faq/cn/api-reference/android-api/Components/Camera/DJICamera.html
There are a few more missing. I see the following (including the ones you mention):
CAMERA_ZOOM(7),
CAMERA_FOCUS(8),
FINE_TUNE_GIMBAL_PITCH(16),
RESET_GIMBAL_YAW(17);
I'll see what I can find out and get back to you.
DJI got back to me the other day, apparently these values are inactive currently, they do nothing in the current release but it's possible that a future release will include the functionality.
No date, version or timeline was indicated on when they might work.
For now, ignore them, they will likely be removed in the next update.
I'm designing a spaceship game in App Inventor. I have a label (lblScore) update when the ship is hit each time. When the ship is hit 3 times, I want the code inside that to execute yet it doesn't work. I've tried multiple variations of this, such as setting it to lblScore.Text instead. Any idea's on how I can address the issue?
Is the lblscore a label?
If it is all you need to do is have a collision block saying whenever the spaceship gets hit, set lblscore = lblscore + 1
This should fix your issue but I would like to see all of your blocks
Do you increment your lblScore in the Ship.CollidedWith event?
If yes, you should move your if statement there, but instead of using the lblScore component as currently, you should better use the lblScore.Text property instead.
Probably it would help us to help you, if you provide a screenshot of your Ship.CollidedWith event...
I'm trying to figure out how to use a bump map. I can add one to a model but nothing happens, probably need to turn on some config option. Please point me to a working example.
I only got this far:
matPlaceholder = new Material(ColorAttribute.createDiffuse(com.badlogic.gdx.graphics.Color.RED), new TextureAttribute(TextureAttribute.Bump, texBump);
You can add it, but the default shader doesn't do Bump Mapping yet.
There are plans of having a composite shader that does that and more. But as far as I know, it isn't ready. You need to write your own shader for that.
There is some good shaders here. Like Normal Mapping. You can give them a try.
CCSprite texture1 = CCSprite.sprite("menu_background.png");
CCRenderTexture layerRenderTexture = CCRenderTexture.renderTexture(width, height);
layerRenderTexture.begin();
texture1.visit(CCDirector.gl);
layerRenderTexture.end();
this.addChild(layerRenderTexture);
I haven't seen any CCRenderTexture example on Internet. When I try to use it as above, I expected to see a nice background. Instead I see black :)
What am I doing wrong?
Thanks for your help.
I haven't seen any CCRenderTexture example on Internet.
I think you may have been looking on the wrong Internet? :)
Check out my article and Ray's article. Both come out on top when you google for CCRenderTexture. They use cocos2d-iphone, but the same principles apply.
In your particular case I don't see you adding the layerRenderTexture as child to the scene or another node. That would explain why you're not getting any results.